CLICK HERE FOR VARIOUS NEW JOBS 
CLICK HERE FOR VARIOUS EDUCATIONAL NEWS 
CLICK HERE FOR NEW SCHOLARSHIPS 
CLICK HERE FOR ADMISSION NOTICES 
Click And Follow On Google+ To Get Updates
Please Wait 10 Seconds... OR You CanSkip

ADMISSION NOTICES
Scholarships

Scholarship-300x291

BUDGET 2014-15
budget_2014-2015
New Date Sheets
VU SOLVED ASSIGNMENTS
Recent Posts

Posts Tagged ‘Fall 2011’

VU CS610- Computer Network FinalTerm solved unsolved past papers FALL 2011

VU CS610- Computer Network FinalTerm Solved Unsolved Past Papers FALL 2011

 

 

1

 

FINAL TERM FALL2011

 

CS610 current final term subjective all solved

 

 

MY paper of CS610 COPUTER NETWORKS

There were 30 MCQs

Question no. 31               (Marks2)

Find the class in 00000001.001011.1001.111

Question no. 32               (Marks2)

What is the difference between unicast and multicast?                  (P# 114)

Unicast: It is used for single destination computer.

Multicast: It is used for multiple destinations; possibly not at same site.

 

 

Question no. 33        (Marks2)

What is the basic concept of Twice NAT(Network Address Translation)P# 114)

Twice NAT is another variant of NAT. it is used with site that runs server. In this process NAT box is connected to Domain Name.

Twice NAT allows a site to run servers. It requires the DNS to interact with the NAT
device. Twice NAT fails if an application uses the IP addresses instead of Domain Name.

 

 

Question no. 34        (Marks2)

What is the role of DMA in NIC?

NIC contains sufficient hardware to process data independent of system CPU.

Most NICs contain DMA circuitry that allow the NIC to operate independent of the CPU

Question no. 35        (Marks2)

What is the function of Hope count matrix in (RIP) Routing Information Protocol? P# 138)

“Hop Count Metric: RIP measures distance in network hops, where each network between the source and destination counts as a single hop.

 

Question no. 36        (Marks2)

What is the scale or level of requirement in of IPv6?   (P# 110)

Scale is also dramatically changed. Size from a few tens to a few tens of millions of computers has been revolutionized. Speed has increased from 56Kbps to 1Gbps. Also there is an increased frame size in hardware.

 

Question No: 37     (Marks: 3)

Change the following into equalant binary

154.31.161.13

202.32.15.7
192.168.1.5

 

 

 

2

 

Question No: 38     (Marks: 3)

What is the meaning of Facilities for Transit Routing as a characteristic of the

Border Gateway Protocol?   (P# 138)

 

Question No: 40 (Marks: 3)

 

Name the six services provided by TCP   (P# 123)

 

Following are the services provided by TCP:

• Connection-oriented service

• Point-to-point

• Complete reliability

• Full-duplex communication

• Stream interface

• Reliable connection startup

• Graceful connection shutdown

 

 

Question No: 42 (Marks: 3)

What are the distance limitations in Fiber Optic? (P# 48)

The fiber-modem coverts digital data into pulses of light then transmits over the optical fiber. It also receives light and converts into digital data.

This mechanism will successfully extend the optical fiber across several kilometers because delays on optical fiber are very low and bandwidth is very high.

Question No: 43     (Marks: 5)

What are the three approaches for datagram forwarding? (P# 143)

1.  FLOOD-AND-PRUNE:

Flood-and-prune is ideal in a situation where the group is small and all members are attached to contiguous Local Area Networks.

2.  CONFIGURATION-AND-TUNNELING:

Configuration-and-tunneling is ideal in a situation where the group is geographically dispersed (i-e., has a few members at each site, with sites separated by long distances). When a multicast datagram arrives, the routers at a site transmit the datagram on all directly attached LANs via hardware multicast.

3.  CORE-BASED DISCOVERY:

To provide smooth growth, some multicast routing protocols designate a core unicast address for each multicast group.

 

Question No: 45     (Marks: 5)

 

Write down the comparison of Distance vector and Link state algorithm?            (P# 143)

DISTANCE-VECTOR ROUTING:

• It is very simple to implement.

• Packet switch updates its own routing table first.

 

 

 

3

 

• It is used in RIP.

LINK-STATE ALGORITHM:

• It is much more complex.

• Switches perform independent computations.

• It is used in OSPF.

 

 

12 Feb

My yesterday’s cs610 paper

1) if there is no signal, how sever come to know there is communication arrived(3)

 

2) IPV6 new features (5) (P# 111)

The new features of IPV6 are as follows:

• IPV6 addresses are 128 bits.

• Header format is entirely different.

• Additional information is stored in optional extension headers, followed by data.

• Flow label and quality of service allows audio and video applications to establish appropriate connections.

• New features can be added more easily. So it is extensible.

 

 

4) features of UDP (3)                                                                    (P# 120)

UDP  is less complex and easier to understand.

• It is an end-to-end protocol. It provides application-to-application communication.

• It provides connectionless service.

• It is a Message-Oriented protocol.

• It uses best-effort delivery service.

• It follows arbitrary interaction.

• It is operating system independent.

 

5) Message oriented Interface, advantages and disadvantages (5)   (P# 120)

MESSAGE-ORIENTED INTERFACE:

UDP offers application programs a Message-Oriented Interface. It does not divide messages into packets for transmission and does not combine messages for delivery. Let’s discuss its advantages and disadvantages.

ADVANTAGES:

• Applications can depend on protocol to preserve data boundaries.

DISADVANTAGES:

• Each UDP message must fit into a single IP datagram.

• It can result to an inefficient use of the underlying network.

 

 

6) Concept of area in OSPF (Open Shortest Path First Protocol) (P# 120)

 

 

 

4

 

 

OSPF AREAS:

 

OSPF allows subdivision of Autonomous System into areas. The link-status information is propagated within an area. The routes are summarized before being propagated to another area. It reduces overhead (less broadcast traffic). Because it allows a manager to partition the routers and networks in an autonomous system into multiple areas, OSPF can scale to handle a larger number of routers than other IGPs.

 

7) Benefits of data stuffing :-                                   P# 120)

In general to distinguish between data being sent and control information such as frame delimiters network systems arrange for the sending side to change the data slightly before it is sent because systems usually insert data or bytes to change data for transmission, the technique is known as Data Stuffing.

 

8) Write some merits used by routing protocols                          P# 135)

A routing protocol is a protocol that specifies how routers communicate with each other, disseminating information that enables them to select routes between any two nodes on a computer network, the choice of the route being done by routing algorithms.
There are two broad classes of Internet Routing Protocol:

INTERIOR GATEWAY PROTOCOLS (IGPs):

It is used among routers within autonomous system. The destinations lie within IGP. EXTERIOR GATEWAY PROTOCOLS (EGPs):

It is used among autonomous systems. The destinations lie throughout Internet

 

 

9) Implementation of NAT (2)                                                                      P# 130)

 

 

 

 

 

 

 

 

 

 

 

 

 

10) unicast rounting and multicast routing                                   P# 114)

MULTICAST ROUTING:

Internet multicast routing is difficult because internet multicast allows arbitrary computer
to join multicast group at any time. It allows arbitrary member to leave multicast group at
any time. It also allows arbitrary computer to send message to a group (even if not a
member)

Unicast: It is used for single destination computer.

 

 

 

5

 

Multicast: It is used for multiple destinations; possibly not at same site.

 

 

11 Feb

30 mcqs from past papers…
45 marks subjective

2 marks (6 qs)

3 marks (6 qs)
5 makrs (3)

why EGP not use routing metric??(5)                                           P# 114)

Although EGP is a dynamic routing protocol, it uses a very simple design. It does not use metrics and therefore cannot make true intelligent routing decisions
We can’t use EGP in routing metric because EGP is used among autonomous systems. The destinations lie throughout Internet

 

How congestion control by tcp?(5)                                                      P# 128)

The goal of congestion control is to avoid adding retransmissions to an already congested network. Reducing the window size quickly in response to the lost messages does it. It is assumed that loss is due to congestion.

 

When a TCP connection first begins, the Slow Start algorithm initializes a congestion
window to one segment, which is the maximum segment size (MSS) initialized by the
receiver  during  the  connection  establishment  phase.  When  acknowledgements  are
returned by the receiver, the congestion window increases by one segment for each
acknowledgement returned. Thus, the sender can transmit the minimum of the congestion
window  and  the  advertised  window  of  the  receiver,  which  is  simply  called  the
transmission window

 

IPv6 addressing (5)                                            P# 114)

 

IPv6 ADDRESSING:

IPv6 uses 128-bit addresses. A 128-bit address includes network prefix and host suffix. An advantage of IPv6 addressing is that it has no address classes i.e. prefix/suffix
boundary can fall anywhere.

Following are special types of addresses, IPv6 uses:
Unicast: It is used for single destination computer.

Multicast: It is used for multiple destinations; possibly not at same site. Cluster: This type of address is used for collection of

 

Define Jitter (2)                                             (P# 66)

 

JITTER:

 

 

 

6

 

Jitter is the term used for variance in transmission delays.

Jitter is significance for voice, video and data. In LANs, jitter can occur when a packet is delayed because the network is busy.

 

DEFINE TCP(2)                                                 (P# 122,123)

TCP provides reliable transport service.    TCP is the major transport protocol in the TCP/IP suite. It uses unreliable datagram service offered by IP when sending data to another computer. It provides reliable data delivery service to applications.

 

What is client server (2)                                           (P# 145)

 

The two application programs make contact in the following way:

One application actively begins execution first and another application waits passively at prearranged location. This process is called client-server interaction.

 

How receiver knows incoming frame is ip datagram (2)

According to its IP address nature because in IP header parts all the information available that which kind of the datagram the receiver received.

 

Why organization does not use single router(3)

 

if there is no signal, how sever come to know there is communication arrived(3) by just guessing and after fixed time the sender can’t received any response so the sender again sent he data so when he received  any ACK than we know now the path is clear the ready to communicate with receiver

 

An other paper

 

what are two important principal that IP address hierarchy grantee? 2 marks

THE IP ADDRESS HIERARCHY:

Each 32-bit IP address is divided into two parts: PREFIX:

It identifies the physical network to which the computers are attached. SUFFIX:

It identifies an individual computer on the network.

 

does OSPF share information within an area or it allow communication b/w

area? 2 marks                                               (P# 141)

OSPF AREAS:

OSPF allows subdivision of Autonomous System into areas. The link-status information

is propagated within an area. The routes are summarized before being propagated to

another area. It reduces overhead (less broadcast traffic). Because it allows a manager to

 

 

 

7

partition the routers and networks in an autonomous system into multiple areas, OSPF can scale to handle a larger number of routers than other IGPs.

 

Where should ICMP message   be sent? 2 marks                                                 (P# 117)

ICMP message is sent in response to incoming datagrams with problems. ICMP message is not sent for ICMP message.

 

How the TCP is is reliable protocol? 2 marks                                                                      (P# 123)

 

Reliability is fundamental in a computer system. Software in the Internet must provide

the same level of reliability as a computer system. Software must guarantee prompt and

reliable communication without any loss, duplication, and change in the order.

 

 

Where the connection is orients service use connection identifier instead of full

address? 2 marks       (P# 67)

 

The connection-oriented service paradigm for networking is similar to the manner in which telephones are used. This is given as follows: A caller dials a number of the destination. The telephone at the destination signals the arrival of a connection request. If the called person does not answer; the caller gives up after waiting for a timeout. If the called person does answer, then the connection is established.

In data communication, as binary connection identifier is given to each of the two Parties to enable identification of the connection.

 

Summarize IP multicast semantics? 2 marks                              (P# 142)

IP MULTICAST SEMANTICS:

IP multicast group is anonymous in two ways:

1. Neither a sender nor a receiver knows the identity or the number of group members.

2. Routers and hosts do not know which applications will send a datagram to a group.

 

Internet routing how does a host join and leave the gorup?3 marks    (on net )

A host sends a request to create, join, or leave a group to an immediate neighbor gateway. If the host requests creation of a group, a new network membership record is created by the serving gateway and distributed to all other gateways.   If the host is the first on its network to join a group, or if the host is the last on its network to leave a group, the group’s network membership record is updated in all gateways

 

Write the new feature if ipv6? 3marks                               (  p # 111 )

The new features of IPV6 are as follows:

• IPV6 addresses are 128 bits.

• Header format is entirely different.

• Additional information is stored in optional extension headers, followed by data.

 

 

 

8

• Flow label and quality of service allows audio and video applications to establish appropriate connections.

• New features can be added more easily. So it is extensible.

 

Difference b/w explicit and implicit frame type? 3 marks                       (  p # 36 )

EXPLICIT FRAME TYPE:

In this type the identifying value is included with frame describes types of included data. IMPLICIT FRAME TYPE:

In implicit frame the receiver must infer from frame data.

 

What is the first address of block if the address is 140.120.84.24/20 ?3 marks

 

 

Characteristics of BGP? 5 marks           ( on net )

Reliable transport protocol
Loop detection

CIDR support

Large routing table support
Policy-based routing

 

VU CS610- Computer Network FinalTerm Solved Unsolved Past Papers FALL 2011

VU cs302 – Digital Logic Design FinalTerm solved unsolved past papers Fall 2011

VU Cs302 – Digital Logic Design FinalTerm Solved Unsolved Past Papers Fall 2011

CS302- Digital Logic Design

Jun 03,2011

SOLVED SUBJECTIVE FROM FINAL TERM

Latest Subjective

PAPERS

 

 

 

 

FINAL TERM EXAMINATION

Fall 2011

 

 

1. In the highest frequency component in an analog signal is 20 KHz, what is the minimum sample

frequency (Marks 2)
Answer:- Click here for detail

In the highest frequency component in an analog signal is 20 KHz, and minimum sample frequency is 40 KHz.

 

2. Write down the ABEL symbols that are used for NOT, AND, OR and XOR operations. (Marks 2) Answer:- Page 201

 

Logic Operation ABEL Symbol
NOT !
AND &
OR #
XOR $

 

3. Differentiate between Moore machine and Mealy machine. (Marks 2) Answer:- Page 318

 

The Sequential circuit whose output depends on the current state and the input is known as Mealy Machine. Sequential circuit whose output is determined by the current state only is known as Moore Machine.

 

4. How many bytes will be there in 16K x 8 memory? (Marks 2) Answer:- Page 395

A 16 K x 8 memory, stores 16K bytes or 16 x 1024 = 16384 bytes or 131072 bits.

 

  1. 1.  How many address bits are required for a 2048-bit memory organized as a 256 x 8 memory? (Marks 3)

 

  1. 2.  Explain Rotate Right Operation of shift register with the help of Diagram.   (Marks 3)

Answer:- Page 354

 

The serial output of the register is connected to the serial input of the register. By applying clock pulses data is shifted right. The data shifted out of the serial out pin at the right hand side is re-circulated back into the shift register input at the left hand side. Thus the data is rotated right within the register.

 

 

 

 

 

 

 

 

 

 

 

3. Difference between State Assignment and State Reduction process. (Marks 3) Answer:- (Page 332 & 335)

 

  1. In state Reduction A state diagram show the sequence of current and next states through which the state machine sequences while in State Assignment Each state in a sequential circuit is identified by a unique combination of binary bits.

 

  1. In state Reduction the transition from a current state to the next state is determined by current state and the inputs while in State Assignment the states can be selected to allow minimum bit changes when changing from one state to the other.

 

  1. State Assignment results in simpler combinational circuits that determine the next state while Reduction in the number of state results in fewer flip-flops and a simpler circuit.

 

 

 

4. Explain Full-Adder Sum and Carry out Boolean Expression. (Marks 3) Answer:- (Page 135)

 

Full-Adder Sum & Carry Out Boolean Expressions

 

The Sum and Carry Out expressions of the Full-Adder can be determined from the function table. The Full-Adder Sum and Carry Out outputs are defined by the expressions

Sum = ABC + ABC + ABC + ABC

 

Sum = A(BC + BC) + A(BC + BC) Sum = A(B ⊕ C) + A(B ⊕ C) Sum = A ⊕ B ⊕ C

 

CarryOut = ABC + ABC + ABC + ABC

CarryOut = C(AB + AB) + AB(C + C)

 

CarryOut = C(A ⊕ B) + AB

 

 

 

1. Explain Latches in your own words. (Marks 5) Answer:- (Page 218)

 

A latch is a temporary storage device that has two stable states. A latch output can change from one state to the other by applying appropriate inputs. A latch normally has two inputs, the binary input combinations at the latch input allows the latch to change its state. A latch has two outputs Q and its complement Q(bar). The latch is said to be in logic high state when Q=1 and Q(bar)=0 and it is in the logic low state when Q=0 and Q(bar)=1. When the latch is set to a certain state it retains its state unless the inputs are changed to set the latch to a new state. Thus a latch is a memory element which is able to retain the information stored in it.

 

 

2. Differentiate between synchronous and asynchronous memory. (Marks 5) Answer:- (Page 406)

 

In the Asynchronous memory the various input signals are asynchronous and are not tied to the clock, whereas in the Synchronous memory all the inputs are synchronized with respect to the clock and are latched into their various registers on an active clock pulse edge.

 

 

 

 

 

4. Draw state diagram of Moore machine. (Marks 5) Answer:- (Page 338)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FINAL TERM EXAMINATION

Spring 2011

 

 

Question No:   ( Marks: 2 )

Write down at least two applications of a shiftregister.

Answer:- (Page 356)

The two applications of the shift registers are

 

  1. Serial to Parallel converter
  2. Keyboard encoder

 

Question No: ( Marks: 2 ) Explain memory expansion process. Answer:- (Page 430)

 

Computer and Digital systems have the capability to allow RAM memory to be expanded as the needed arises by inserting extra memory in dedicated memory sockets on the computer motherboard.

 

 

Question No:   ( Marks: 2 )

Draw the NOR based S-R Latch

Answer:- (Page 220)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Question No:   ( Marks: 3 )

Explain Rotate Left Right Operation with the help of diagram.

Answer:- (Page 354)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Question No:   ( Marks: 3 )

 

You are given the block diagram of 74HC190 integrated circuit up/down counter, explain the function of labeled inputs/outputs.

 

 

 

 

 

 

 

 

 

 

Answer:-(Page 295)

 

 

  1. Active-low CTEN counter enable input

 

  1. D/U the count down/up input. When the input is set to logic 1, the counter counts down and when the input is set to logic 0, the counter counts up

 

  1. The MAX/MIN output that is set to high when the terminal count 1001 is reached when counting up or when the terminal count 0000 is reached when counting down. The MAX/MIN output is logic high for one complete cycle when a terminal count is reached.

 

Question No:   ( Marks: 5 )

 

Explain Memory Select or Enable Signals Answer:- (Page 397)

 

In a computer system there are more than one memory chips to store program information. At any particular instant a read or write operation is carried out on a single addressable location. The unique location can only be accessed in one of the several memory chips, thus a single memory chip has to be selected before a read or write operation can be carried out. All memory chips have a chip enable or chip select signal which has to be activated before the memory can be accessed.

 

 

 

 

Question No:  ( Marks: 5 )

 

Explain the implementation of First In First Out (FIFO) Memory by using RAM. Answer:- (Page 427)

 

Shift register based FIFO memory is used in digital systems designed for specific applications where small sized buffers are used to allow transfer of data between two devices operating at different data rates. Such digital systems either have no RAM or very small RAM for storing variables. Computers implement FIFO memory by reserving a part of their RAM memory for use as buffers. The Keyboard buffer for example is implemented by reserving a part of the RAM. When RAM is used as FIFO memory, two registers are used to point to the FIFO Buffer Out and Buffer In respectively. The two registers hold the addresses of the locations of the Buffer Out and Buffer In respectively, which are updated as new data is written into the buffer and previous data is read out from the FIFO buffer. Implementation of the FIFO buffer in RAM is usually takes the form of a circular buffer.

 

Question No:  ( Marks: 5 )

 

Explain application of demultiplexer Answer:- (Page 178)

 

Demultiplexer is used to connect a single source to multiple destinations. One use of the Demultiplexer is at the output of the ALU circuit. The output of the ALU has to be stored in one of the multiple registers or storage units. The Data input of the Demultiplexer is connected to the output of the ALU. Each output of the Demultiplexer is connected to each of the multiple registers. By selecting the appropriate output data from the ALU is routed to the appropriate register for storage.

 

The second use of the Demultiplexer is the reconstruction of Parallel Data from the incoming serial data stream. Serial data arrives at the Data input of the Demultiplexer at fixed time intervals. A counter attached to the Select inputs of the Demultiplexer routes the incoming serial bits to successive outputs where each bit is stored. When all the bits have been stored, data can be read out in parallel.

 

 

FINAL TERM EXAMINATION

Spring 2011

 

Question No: 27   ( Marks: 2 )

 

1:  Explain the erase operation in context of Flash Memory. Answer:- (Page 421)

 

During the erase operation charge is removed from the memory cell. A sufficiently large positive voltage is applied at the source with respect to the control gate. The voltage applied across the control gate and source is opposite to the voltage applied during programming. If charges are present on the gate, the positive voltage supply at the source attracts the electrons depleting the gate. A FLASH memory is erased prior to programming.

 

2:  How can a serial in/parallel out register be used as a serial in/serial out register?

 

3:  Explain the next-state table with the help of a table for any sequential circuit?

 

Answer:- (Page 306)

 

Once the state diagram of the sequential circuit is defined, a Next-State Table is derived which lists each present state and the corresponding next state. The next state is the state to which the sequential circuit switches when a clock transition occurs.

 

Present State Next State
Q2 Q1 Q0 Q2 Q1 Q0
0 0 0 0 0 1
0 0 1 0 1 0
0 1 0 0 1 1
0 1 1 1 0 0
1 0 0 1 0 1
1 0 1 1 1 0
1 1 0 1 1 1
1 1 1 0 0 0

 

 

 

4:  What is meant by Non-Monotonicity of Digital to Analog converter? Answer:- (Page 460)

 

if the D/A converter outputs a lower voltage than its preceding output voltage the converter is said to exhibit non-monotonic behavior.

 

5:  Two state assignments are given in the table below. Identify which state assignment is best and why?

States State assignment 1 State assignment 2
A 00 00
B 01 01
C 11 10
D 10 11

 

 

6:  Write down at least two functions of a register. Answer:- (Page 306)

 

Technically, a register performs two basic functions. It stores data and it moves or shifts data. The shifting of data involves shifting of bits from one flip-flop to the other within the register or moving data in and out of the register. The shift operation of the binary data is carried out by applying clock signals. Several different kinds of shift operations can be identified.

 

7:  You are given the Next-state table of a Moore machine, using this information draw the state diagram of the machine.

 

Present State Next State
Q2 Q1 Q0 Q2 Q1 Q0
0 1 1 1 1 1
1 1 1 0 0 1
0 0 1 0 1 0
0 1 0 1 0 0
1 0 0 1 1 0
1 1 0 0 1 1

 

 

Answer:-(Page 338)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FINAL TERM EXAMINATION

Spring 2011

 

QNo.1 Define the term “Variable” in context of Boolean algebra. Answer:- (Page 71)

 

A variable is a symbol usually an uppercase letter used to represent a logical quantity. A variable can have a 0 or 1 value.

 

 

Q No.2 A general sequential circuit consists of a combinational circuit and memory elements. How this Memory element is implemented.

 

Answer:- (Page 318)

 

A general Sequential circuit consists of a combinational circuit and a memory element. The memory element is made of a set of n flip-flops all connected to a a common clock. The n flip flops store 2n states. The flip-flops change their current state to the next state on each clock transition. The next state is determined by the current state and the external input. The output of the State Machine is determined by the current state and external input. The inputs to the memory which allow the memory to change its state on a clock transition are known as excitation inputs or excitation variables.

 

Q No.3 what is meant by Monotonicity of Digital to Analog converter? Answer:- (Page 460)

 

The output of the D/A converter should give an increasing analogue voltage output when the binary input is varied between its minimum and maximum values.

 

Q No.4 Explain Programmable Logic Devices? Answer:-(Page 179)

 

Programmable Logic Devices are used in many applications to replace the Logic gates and MSI chips. PLDs save circuit space and reduce and save the cost of components in a Digital Circuit. PLDS consists of Arrays of AND gates and OR gates that can be programmed to perform specific functions.

 

Q No.5 How many clock pulses are required to enter a byte of data serially into an 8-bit shift register? 2 Answer:- 8 clock pulses are required to enter a byte of data serially into an 8- bit shift register

 

Q No. 6 How can calculate the frequency of an unknown signal? Answer:-(Page 301)

 

The frequency of the unknown signal can be calculated by counting the number of clock pulses of the unknown signal and dividing the count number by the time interval in which the clock pulses are counted,

 

Q No. 7 Write the drawbacks of 16-bit ALU without look-Ahead carry circuit?

Q No. 8 How many address bit are required for a 2048-bit memory organized as a 256*8 memory?

 

Q No. 9 Differentiates between Memory capacity and Memory Density? Answer:- (Page 395)

 

Each memory array has a maximum capacity to store information in the form of bits. Memory density on the other hand specifies the number of bits stored per unit area. More the number of bits stored in a unit area more dense the memory, that is, more bits are stored in less space.

 

Q No. 10. Explain Memory Select or Enable signal? Answer:- (Page 397)

 

In a computer system there are more than one memory chips to store program information. At any particular instant a read or write operation is carried out on a single addressable location. The unique location can only be accessed in one of the several memory chips, thus a single memory chip has to be selected before a read or write operation can be carried out. All memory chips have a chip enable or chip select signal which has to be activated before the memory can be accessed.

 

 

Q No 11. Explain state Assignment Process. Answer:-(Page 335)

 

Each state in a sequential circuit is identified by a unique combination of binary bits. Unless the output of the sequential is directly taken form the flip-flop outputs such as counters, the states can be selected to allow minimum bit changes when changing from one state to the other. Keeping the bits changes to minimum when changing from one state to the next, results in simpler combinational circuits that determine the next state.

 

Q No 12. Briefly Explain Next-state table with the help of any sequential circuit.5 Answer:- Repeated

 

 

 

 

 

FINAL TERM EXAMINATION

 

Spring 2011

 

 

 

  1. 1.  In the highest frequency component in an analog signal is 20 KHz, what is the minimum sample frequency

 

Answer:- Repeated

 

  1. 2.  How many bytes will be there in 16K x 8 memory?

Answer:- Repeated

 

3. Convert the hexadecimal number 7AB1 into binary numbers. Write down all the steps. Answer:- (Page 27)

Replacing each Hexadecimal digit by its 4-bit binary equivalent

7= 0111, A= 1010, B=1011, 1= 0001           So, 7AB1 = 0111101010110001

 

  1. 4.  Explain grouping of cells in k-map. 3 Answer:- (Page 90)

 

Groups are formed on the basis of 1s (Minterms) or 0s (maxterms). A group is selected to have maximum number of cells of Minterms or Maxterms, keeping in view that the size of the group should be a power of 2. The idea is to form minimal number of largest groups that uniquely cover all the cells, thereby ensuring that all minterms or maxterms are included.

 

  1. 5.  Provide some of guidelines for selection of state assignment. 3

Answer:-(Page 337)

Generally, the selection of State Assignment is based on the following guidelines.

 

  • Choose an initial coded state into which the state machine (sequential circuit) can easily be forced to reset (000 or 111)

 

  • Minimize the State Variables that change on each transition
  • Maximize the number of state variables that don’t change in a group of related states
  • If there are unused states, then choose the best state variable combinations to achieve the first three goals.

 

 

  1. 6.  Discuss at least one difference in Johnson and ring Counter 3 Answer:-(Page 355)

 

The Ring Counter is similar to the Johnson counter, except that the Q output of the last flip-flop of the shift register is connected to the data input of the first flip-flop of the shift register.

 

  1. 7.  Three types of error while converting Analogue signal into digital. 3

Answer:-(Page 354)

  1. Missing Code
    1. Incorrect Code
    2. Offset Error

 

8. Explain memory read operation with help of example 5 Answer:- (page 397)

 

Memory Read operation is carried out by first selecting the memory chip by activating the Memory Select signal. The Read signal is asserted to configure the memory circuitry for reading data from the memory. An address (100) is applied on the Address Lines. The internal address decoder of the memory decodes the address and selects one unique row from which data is read. Figure 39.4.

 

 

 

 

 

 

 

 

 

 

 

 

 

The address of the location in the memory from which data is to be read is supplied by the microprocessor. The microprocessor stores the address in its address buffer. The data read from the memory is stored in a data buffer inside the microprocessor. In the diagram shown, a microprocessor places an address 100 on its external address bus connected to the address lines of the memory. The internal address decoder of the memory decodes the address 100 and activates a row select line which selects the row location 4. The data

 

(00110001) at the location is read from the memory and placed on the data bus where it is latched by the microprocessor and stored in its data buffer.

 

9. Explain flesh analogue to digital converter 5 Answer:- (Page 447)

 

The Flash A/D converter is based on a resistor potential divider, where multiple resistors of identical value form a voltage divider. A reference voltage is applied at one end of the potential divider which divides the voltage equally across all the resistors. The input analogue voltage is applied at the non-inverting inputs of a set of Op-Amp based comparators. The inverting input of each comparator is connected to the resistive voltage divider which provides reference voltages for all the comparators. If the input voltage is larger than the reference voltage the output of the comparator is logic high otherwise it is logic low. The outputs of all the comparators are connected to the input of a priority encoder which converts the comparator outputs to a binary coded equivalent value.

 

 

10. Briefly explain address multiplexing in DRAM. 5 Answer:- (Page 410)

 

DRAM chips use address multiplexing to reduce the number of address lines by half. The address required to select a memory location is split into row and column addresses. To access a DRAM location for reading or writing of information the row address is first applied at the address lines. The row address is latched by the Row Address Latch of the DRAM memory chip. The column address is applied next at the same address lines. The column address is latched by the Column Address Latch. Two signals RAS and CAS are used as strobe signals to control the Row Address and Column Address latches respectively. The external address lines are multiplexed as the same set of address lines are used to apply the row address and the column address at different time instances. The outputs of the Row Address Latch and the Column Address Latch are connected to the Row and Column Decoders which select a single row and column line selecting the storage cell to be accessed.

 

 

 

 

FINAL TERM EXAMINATION

Spring 2011

 

 

 

Explain READ Write signal used for memory. 03 Answer:- (Page 396)

 

Read/Write signals are required to configure the memory for read and write operation. Memory chips have a single Read/Write signal. When the signal is set to high it allows data to be read from the memory. When the signal is set to low data is written into the memory. Some memory chips have two separate Read and Write signals. The read and write signals are separately asserted to control the Read and Write operation.

 

 

What is difference between PROM and ROM. 03

Answer:-           Click here for detail

 

The difference between a PROM and a ROM (read-only memory) is that a PROM is manufactured as blank memory, whereas a ROM is programmed during the manufacturing process. To write data onto a PROM chip, you need a special device called a PROM programmer or PROM burner. The process of programming a PROM is sometimes called burning the PROM.

 

Making decade counter by cascading two 74HC163. 05

 

What is difference between memory capacity and memory density? 05

 

Answer:- Repeated

 

Describe Flash Analogue to Digital converter. 05

Answer:- Repeated

 

 

Explain don‟s care condition.

Answer:- (Page 96)

 

Function Tables represent the function by listing all the possible inputs and marking the corresponding outputs with 1s and 0s. Thus a circuit having four inputs can be described by a 4-variable function table having 16 possible input combinations. For each of the 16 possible input conditions the corresponding output bits are marked as 1s and 0s depending upon the minterms or maxterms. It is however, possible that out of the 16 possible input combinations, three input combinations never occur. Since these three input combinations never occur so should their corresponding outputs be marked as 0s or 1s? Since these inputs never care therefore we don’t need to worry about the output of these input states. They are considered to be don’t care conditions.

 

 

 

 

FINAL TERM EXAMINATION 2011

 

Question#1

Give advantages of Counters are available in integrated circuits?          (Marks 2)

Question #2

Successive approximation counter have a fixed consecutive time Is tarha ka qs tha        (Marks 2)

 

Question #4

 

How many states in 8-bit Johnson counter? (Marks 2) Answer:-(Page 354)

 

The sequence of states that are implemented by a n-bit Johnson counter are 2n So, 8 bit Johnson counter has 2*8 = 16 states

 

Question #5

Diff b/w truth table and next state table               (Marks 3)

 

Question #6

 

How hexadecimal number is converted into binary number give one example? (Marks 3) Answer:-(Page 28)

 

Converting from Hexadecimal back to binary is also very simple. Each digit of the Hexadecimal number is replaced by an equivalent binary string of 4-bits. FD13 Hexadecimal Number 1111 1101 0001 0011 Replacing each Hexadecimal digit by its 4-bit binary equivalent

 

Question #7

Diff b/w ROM and PROM?      (Marks 3)

 

Answer:- Repeat

 

Question #8

How we can implement full adder from two half adder?            (Marks 3)

Answer:- Repeat

 

 

Question #9

Make State diagram?

Answer:- Repeat

 

Question #10

Explain FRGA?             (Marks 5)

Answer:- (Page 437)

 

Programmable Logic Devices are based on a programmable AND-OR gate array which are programmed to implement any function in the SOP form. The output of the AND-OR gate array can be directly used as a combinational circuit output. Provision is there to connect the output of the AND-OR gate array to a D-flip-flop for Sequential circuit operation. An FPGA is a more flexible device than PLDs as instead of a single AND-OR gate array, an FPGA device contains multiple logic blocks that can be individually programmed to perform different functions. Each Logic Block is connected to other blocks through row and column interconnects that can be programmed to connect any Logic block to another.

 

Question #11       (Marks 5)

Differentiate b/w memory density and memory capacity?

 

Answer:- Repeated

 

 

FINAL TERM EXAMINATION

Spring 2010

 

Question No: 27 (Mark s: 2) Define quantization process. Answer:- (Page 444)

The process of converting the analogue signal into a digital representation (code) is known as quantization

 

Question No: 28 (Marks: 2)

 

Explain the difference between 1-to-4 Demultiplexer and 2-to-4 Binary Decoder? Answer:- (Page 178)

 

The only difference between the two is the addition of the Data Input line, which is used as enable line in the 2-to-4 Decoder circuit figure 16.10. Assuming the select inputs I1 and I0 are set to 1 and 0 respectively. The O2 output is set to 1 if the Data input is 1 or it is set to 0 if the Data input is 0.

 

Question No: 29 (Marks: 2)

 

A general Sequential circuit consists of a combinational circuit and a memory element. How this memory element is implemented

 

Answer:- Repeated

 

Question No: 30 (Marks: 2)

 

Suppose a 2 bit up-counter, having states “A, B, C, D”. Write down GOTO statements to show how present states change to next states.

 

 

Question No: 31 (Marks: 3)

Name three Operations that can be performed on FLASH Memory

Answer:- (Page 420)

FLASH Memory operations are classified into

 

  • Programming Operation
  • Read Operation
  • Erase Operation

 

Question No: 32 (Marks: 3)

Explain Rotate Right Operation of shift register with the help of diagram.

Answer:- Repeated

 

Question No: 33   ( Marks: 3 )

 

You are given the block diagram of 74HC190 integrated circuit up/down counter, explain the function of labeled inputs/outputs.

 

 

 

 

 

 

 

 

 

 

 

 

Answer:- Repeated

 

Question No: 34 ( Marks: 5 )

 

Draw the state diagram of 3-bit up-down counter, use an external input X, when X sets to logic 1, the counter counts downwards, otherwise upward.

 

Question No: 35 (Marks: 5)

 

Differentiate between synchronous and asynchronous RAM. Answer:- (Page 406)

 

Synchronous RAM is very similar to the Asynchronous RAM, in terms of the memory array, the address decoders, read/write and enable inputs. In the Asynchronous memory the various input signals are asynchronous and are not tied to the clock, whereas in the Synchronous memory all the inputs are synchronized with respect to the clock and are latched into their various registers on an active clock pulse edge.

 

Question No: 36 ( Marks: 5 )

Explain Memory Select or Enable Signals

Answer:- Repeated

 

 

 

FINAL TERM EXAMINATION

Spring 2010

 

 

Question No: 27   ( Marks: 2 )

 

Draw the Truth-Table of NOR based S-R Latch

Answer:- (Page 222)

Input Output
S R Qt+1
0 0 Qt
0 1 0
1 0 1
1 1 invalid

 

Table 22.3   Truth-Table of NOR based S-R Latch

 

 

 

 

Question No: 28   ( Marks: 2 )

Two state assignments are given in the table below. Identify which state assignment is best and why?

 

States

State Assignment 1

State Assignment 1

A

00

00

B

01

01

C

11

10

D

10

11

Question No: 29 ( Marks: 2 )
Write down at least two functions of a register.
Answer:- Repeat
Question No: 30 ( Marks: 2 )
Define quantization process.
Answer:- Repeat
Question No: 31 ( Marks: 3 )

 

How can we calculate the frequency of an unknown signal?

Answer:- Repeat

 

 

 

 

Question No: 32   ( Marks: 3 )

 

 

Given the following statement used in PLD programming: Y PIN 23 ISTYPE „com‟;

 

Explain what does this statement mean? Answer:- (Page 360)

 

The statement describes Y available at output pins 23. The Y variable is a ‘Combinational’ output available directly from the AND-OR gate array output. The active-low or active-high output of the Registered Mode can also be specified in the declaration statement

 

Question No: 33   ( Marks: 3 )

 

Explain dynamic RAM in your own words. Answer:- Click here for detail

 

Dynamic random-access memory (DRAM) is a type of random-access memory that stores each bit of data in a separate capacitor within an integrated circuit. The capacitor can be either charged or discharged; these two states are taken to represent the two values of a bit, conventionally called 0 and 1. Since capacitors leak charge, the information eventually fades unless the capacitor charge is refreshed periodically. Because of this refresh requirement, it is a dynamic memory as opposed to SRAM and other static memory.

 

Question No: 34   ( Marks: 5 )

 

You are given the Next-state table of a Moore machine, using this information draw the state diagram of the machine.

 

 

Present State Next State
Q2 Q1 Q0 Q2 Q1 Q0
0 1 1 1 1 1
1 1 1 0 0 1
0 0 1 0 1 0
0 1 0 1 0 0
1 0 0 1 1 0
1 1 0 0 1 1
Answer:- repeat
Question No: 35 ( Marks: 5 )
Explain Memory Select or Enable Signals
Answer:- repeat
Question No: 36 ( Marks: 5 )

 

Performance characteristics of D/A converters are determined by five parameters. Name them. Answer:- (Page 460)

Performances characteristics of D/A converters are determined by five parameters are:

1. Resolution           2. Linearity             3. Monotonicity      4. Setting time          5. Accuracy

 

 

FINAL TERM EXAMINATION

 

 

Spring 2010

 

Question No: 27   (Marks: 2)

Explain the erase operation in context of Flash Memory.

Answer:- repeat

 

Question No: 28   (Marks: 2)

 

Explain the difference between 1-to-4 Demultiplexer and 2-to-4 Binary Decoder? Answer:- repeat

 

Question No: 29   (Marks: 2)

 

Some of the counters (e.g. 74HC163) are called pre-set counters. why? Answer:- Click here for detail

 

74HC163) are called pre-set counters because A counter set in advance to stop or produce output once a specific count has been reached.

 

Question No: 30   (Marks: 2)

How many bytes will be there in 32 K x 8 memory?

 

Answer:- (Page 395)

A 32 K x 4 memory stores 32K nibbles or 32 x 1024 = 32768 nibbles

 

Question No: 31   (Marks: 3)

Differentiate between truth table and next-state table

 

Question No: 32   (Marks: 3)

 

Name the three types of errors Analogue to Digital converters exhibit during their conversion operation. Answer:- repeat

 

Question No: 33   (Marks: 3)

How can a serial in/parallel out register be used as a serial in/serial out register?

 

Question No: 34   (Marks: 5)

 

Explain the implementation of First In First out (FIFO) Memory by using RAM. Answer:- repeat

 

Question No: 35   (Marks: 5)

Explain memory read operation with the help of an example

 

Answer:- repeat

 

Question No: 36   (Marks: 5)

Explain the next-state table with the help of a table for any sequential circuit

Answer:- repeat

 

VU Cs302 – Digital Logic Design FinalTerm Solved Unsolved Past Papers Fall 2011

VU CS201- Introduction to Programming FinalTerm solved unsolved past papers Fall 2011

VU CS201- Introduction To Programming FinalTerm Solved Unsolved Past Papers Fall 2011

CS201- Introduction to Programming

July 16,2011

Latest Solved subjective from Final term Papers

Mc100401285 Moaaz Siddiq

 

Final term Examination

 

Fall 2011

 

Question 1:-

 

Identify each of the following as system software and application software. (mark 5) LINUX, DISK CLEANUP, WORD PROCESSOR, WINDOWS, STUDENT INFORMATION

 

Answer:-

 

System software: – Linux, Disk cleanup, windows. Application software:- Word Processor, Student information

 

Question 2:-

 

Write a program which defines three variables of type double which store three different values including decimal points, using set precision manipulators to print all these values with different numbers of digits after the decimal number.(5)

 

Answer:-

#include

 

#include int main ()

 

{

double x1 = 12345624.72345 double x2 = 987654.12345 double x3 = 1985.23456

 

cout << setprecision (3) << x1<< endl; cout << setprecision (4) << x2 << endl; cout << setprecision (5) << x3<< endl; return 0;

}

 

Question 3:-

 

Define static variable also explain life time of static variable? (3) Answer:

 

Static variable means maintaining the state of a variable. It exists and lives around even when we are outside the function. It is created and initialized only once during the lifetime of the program and therefore it will be destroyed or taken out of memory only once during the lifetime of the program.

 

Question 4:-

 

What do you know about run time error? (3) Answer:

Run-Time Errors

• Occur when the program is running and tries to do something that is against the

 

 

1

 

 

rules

 

Example: Accessing a non-existent variable, property, method, object, etc (e.g. a method name is misspelled)

 

• Sources of these can be determined by a careful reading of the code, but unfortunately, not always

 

Question 5:

 

What is limitation of the friendship between classes? (3) Answer:

 

Friendship relation between classes is a one way relation that is if one class declare friend another class then the another class is the friend of first class but not the first class if the friend of another class.

 

Question 6:

 

what is the source and destination of cin?(2) Answer:

For cin, the source is normally keyboard and the destination can be an ordinary variable i.e. native-data type variable

 

Question 6:

 

Write the general syntax of allocation memory dynamically to an array using new operator? (2) Answer: Page 332

Following is the syntax:

 

new data_type [number_of_locations];

 

Question 7:

 

What is diffrent between pointer and variable? Answer:-

 

normal variable contains tha value of variable either int or float whereas pointer variable contains the address of another variable

 

Question 8:

 

What is difference between Unary and binary operators and how they can be overloaded? Answer:-

Unary operator takes one argument. a ++ is an example of unary operator Binary take two operators

 

+,-,* are example of binary operators Overloaded binary operator may return any type Here is general syntax of overloading Return-type operator symbol (parameters); Operator is keyword

 

Question 9:

 

How many types of templates? Answer:-

There are two different types of templates in C++ language i.e.’ function templates and class templates.

 

Question 10:

 

What will be the output of following function if we call this function by passing int 5? template T reciprocal(T x) {return (1/x); }

 

2

 

 

Answer:-

 

0

The output will zero as 1/5 and its .05 but conversion to int make it zero

Above is prototype of template class so assume passing an int and returning an int

 

 

Question 11:

 

Identify the errors in the following member operator function and also correct them. math * operator(math m);

 

math * operator (math m)

{

math temp;

temp.number= number * number; return number;

 

Answer:-

 

The errors are in the arguments of the member operation function and also in the body of operator member function.

 

Correct function should be math *operator(math *m); math *operator (math *m)

{

math temp; temp = m;

temp.number= number * number; return temp.number;

 

Final term Examination

 

Fall 2011

 

Question No.1:

 

Define buffer? Explain its usage? 5 MARKS Answer:

a program that writes the output data to the disc, it will be nice to collect the output data (numbers) and write it on the disc in one write operation instead of writing the numbers one by one. The area where we gather the numbers is known as buffer.

 

Question No.2:

 

Why binary search algorithm is efficient than linear search algorithm? 5 marks

Answer: (page118)

 

Binary search algorithm is more efficient than liner algorithm because the arrays are sorted in ascending or descending order and we use “divide and conquer” technique. In binary search each iteration reduces the search by the factor of two but in the linear we have the same number of searches as we have the number of elements. E.g. if we have array of 1000 elements the linear search will take 1000 iterations however binary search will take max 10.

 

Question No.3:

 

Operator function ka syntax (3 marks)

 

3

 

 

Question No.4:

 

Post increment and pre increment k syntax btana thay(2 marks)

Answer:

Classname operator ++(); —- pre increment

 

Classname operator ++(int) —- post increment

 

Question No.5:

 

What is language translator?(2 marks) Answer: Page 12

So we need a translator which translates the code of our program into machine language. There are two kinds of translators which are known as Interpreter and Compilers. These translators translate our program which is written in C-Language into Machine language

 

Question No.6:

 

Write something something about testing in designing program? 3 MARKS Answer:-

 

Testing. The programmer should design a test plan and use it to test the program. It is a good idea, when possible, to have someone else test the program.

 

Question No.7:

 

Read the given below code and explain what task is being performed by this function 5 MARKS

 

Matrix :: Matrix ( int row , int col )

 

{

numRows = row ; numCols = col ;

elements = new ( double * ) [ numRows ] ; for ( int i = 0 ; i < numRows ; i ++ )

 

{

elements [ i ] = new double [ numCols ] ; for ( int j = 0 ; j < numCols ; j ++ ) elements [ i ] [ j ] = 0.0 ;

 

}

}

 

 

 

 

Hint : This function belong to a matrix class, having Number of Rows = numRows

 

Number of Columns = numCols

Which one (copy constructor or assignment operator) will be called in each of the following code segment?

 

1)  Matrix m1 (m2);

2)  Matrix m1, m2; m1 = m2;

3)  Matrix m1 = m2;

 

Answer:-

 

In this code the matrix function is defined, it get the number of rows from the user and create the row of

 

4

 

 

matrix and then get the columns from the user and create the columns. The New is showing for creating more array space for the data which user enters. The elements [i][j] will print the data in matrix

 

FINALTERM EXAMINATION

 

Spring 2010

 

Question No: 27  ( Marks: 2 )

 

How many arguments a Unary Operator take? Can we make a binary operator as unary operator? Answer:-

Unary operator takes only one arguments like i++ or i– (Post increment or post decrement operators for integers) or ++i,–i (Pre increment or pre decrement operators for integers) ,we can not make Unary operator as binary or binary as Unary operator.

 

 

 

 

Question No: 28  ( Marks: 2 )

 

Which arithmetic operators cannot have a floating point operand?

Answer:-

Modulus operator

 

This operator can only be used with integer operands ONLY

 

 

Question No: 29  ( Marks: 2 )

 

What are manipulators? Give one example.

 

Answer:-

 

The manipulators are like something that can be inserted into stream, effecting a change in the behavior. For example, if we have a floating point number, say pi (л), and have written it as float pi = 3.1415926 ; Now there is need of printing the value of pi up to two decimal places i.e. 3.14 . This is a formatting functionality. For this, we have a manipulator that tells about width and number of decimal points of a number being printed.

 

OR

 

Answer: Manipulators are operators used in C++ for formatting output. The data is manipulated by the programmer’s choice of displayed.

 

Endl manipulator: This manipulator has the same functionality as the „\n newline character.

 

Question No: 30  ( Marks: 2 )

 

Write down piece of code that will declare a matrix of 3×3. And initialize all its locations with 0;

 

Answer:-

 

int matrix [3] [3] ;

 

matrix [0] [0] = 0; matrix [0] [1] = 0; matrix [0] [2] = 0; matrix [1] [0] = 0; matrix [1] [2] = 0; matrix [1] [2] = 0; matrix [2] [0] = 0; matrix [2] [1] = 0;

 

5

 

 

matrix [2] [2] = 0;

 

Another answer:-

 

we can also do it as given below

int matrix [3][3] = { 0 }; //all elements 0

 

 

 

Question No: 31  ( Marks: 3 )

 

Which one (copy constructor or assignment operator) will be called in each of the following code segment?

1)                 Matrix m1 (m2);

2)                 Matrix m1, m2; m1 = m2;

 

3)                 Matrix m1 = m2;

 

Answer:-

 

1)                 Matrix m1 (m2); copy constructor

2)                 Matrix m1, m2;

m1 = m2;              assignment operator

3)                 Matrix m1 = m2; assignment operator

 

 

Question No: 32  ( Marks: 3 )

 

What will be the output of following function if we call this function by passing int 5?

 

template <class T> T reciprocal(T x)

 

{

return (1/x);

 

}

 

Answer:-

 

0

The output will zero as 1/5 and its .05 but conversion to int make it zero

 

Above is prototype of template class so assume passing an int and returning an int

 

 

Question No: 33  ( Marks: 3 )

 

Identify the errors in the following member operator function and also correct them. math * operator(math m);

 

math * operator (math m)

 

{

math temp;

temp.number= number * number; return number;

 

}

 

6

 

 

Answer:-

 

The errors are in the arguments of the member operation function and also in the body of operator member function.

 

Correct function should be

 

math *operator(math *m);

 

math *operator (math *m)

 

{

math temp; temp = m;

 

temp.number= number * number; return temp.number;

 

}

 

 

 

 

 

Question No: 34  ( Marks: 5 )

 

Write a program which defines three variables of type double which store three different values including decimal points, using setprecision manipulators to print all these values with different number of digits after the decimal number.

 

Answer:-

 

#include <iostream> #include <iomanip>

 

int main ()

 

{

double x1 = 12345624.72345 double x2 = 987654.12345 double x3 = 1985.23456

 

cout << setprecision (3) << x1<< endl; cout << setprecision (4) << x2 << endl; cout << setprecision (5) << x3<< endl;

 

return 0;

 

}

 

 

 

 

Question No: 35  ( Marks: 5 )

 

What are the advantages and disadvantages of using templates?

Answer:-Page 518

 

Many thing can be possible without using templates but it do offer several clear advantages not offered by any other techniques:

Advanatages:

• Templates are easier to write than writing several versions of your similar code for different types. You

 

7

 

 

create only one generic version of your class or function instead of manually creating specializations.

 

  • Templates are type-safe. This is because the types that templates act upon are known at compile time, so the compiler can perform type checking before errors occur.

 

  • Templates can be easier to understand, since they can provide a straightforward way of abstracting type information.
  • It help in utilizing compiler optimizations to the extreme. Then of course there is room for misuse of the templates. On one hand they provide an excellent mechanism to create specific type-safe classes from a generic definition with little overhead.

 

Disadvantages:

 

On the other hand, if misused

  • Templates can make code difficult to read and follow depending upon coding style.

 

  • They can present seriously confusing syntactical problems esp. when the code is large and spread over several header and source files.
  • Then, there are times, when templates can “excellently” produce nearly meaningless compiler errors thus requiring extra care to enforce syntactical and other design constraints. A common mistake is the angle bracket problem.

 

 

 

 

Question No: 36  ( Marks: 5 )

 

Suppose a program has a math class having only one data member number.

Write the declaration and definition of operator function to overload + operator for the statements of main function.

math obj1, obj2; obj2= 10 + obj1 ;

 

Answer:-

 

#include <iostream.h> math

 

{

mth operator + (obj1,obj2) mth operator + (obj1,obj2)

{

mth operator + (obj1,obj2) mth operator + (obj1,obj2)

 

}

}

 

 

FINALTERM EXAMINATION

 

Spring 2010

 

CS201- Introduction to Programming

 

 

Question No: 32  ( Marks: 3 )

 

Is it possible to define two functions as given below? Justify your answer. func(int x, int y)

func(int &x, int &y) Answer:-

No, we cannot define two functions as func(intx, inty) func(int &x, int&y) because it’s give an error

 

 

8

 

 

function not initializing.

 

Question No: 33  ( Marks: 3 )

 

What happens when we use new and delete operator? Answer:

When we use NEW operator to create objects the memory space is allocated for the object and then its constructor is called. Similarly, when we use DELETE operator with our objects, the destructor is called for the object before deallocating the storage to the object.

 

Question No: 34  ( Marks: 5 )

 

What is the difference between function overloading and operator overloading?

Answer:-

Difference b/w function overloading and operator overloading is:

In function overloading, the functions have the same name but differ either by the number of arguments or the type of the arguments.

 

Operator overloading is to allow the same operator to be bound to more than one implementation, depending on the types of the operands.

 

 

 

 

 

Question No: 35  ( Marks: 5 )

 

Why the first parameter of operator function for << operator must be passed by reference? Answer:-

 

Operator<<‘s first parameter must be an ostream passed by reference. Its second parameter, the IntList that is printed, does not have to be passed as a const-reference parameter; however it is more efficient to pass it by reference than by value (since that avoids a call to the copy constructor), and it should not be modified by operator<<, so it should be a const reference parameter

 

 

Question No: 36  ( Marks: 5 )

 

Read the given below code and explain what task is being performed by this function

 

Matrix :: Matrix ( int row , int col )

 

{

numRows = row ; numCols = col ;

elements = new ( double * ) [ numRows ] ; for ( int i = 0 ; i < numRows ; i ++ )

{

 

elements [ i ] = new double [ numCols ] ; for ( int j = 0 ; j < numCols ; j ++ )

elements [ i ] [ j ] = 0.0 ;

}

 

}

 

 

 

 

Hint : This function belong to a matrix class, having

 

Number of Rows = numRows

 

9

 

 

Number of Columns = numCols

 

Answer:

 

In this code the matrix function is defined, it get the number of rows from the user and create the row of matrix and then get the columns from the user and create the columns. The New is showing for creating more array space for the data which user enters. The elements [i][j] will print the data in matrix form. http://vustudents.ning.com

 

FINALTERM EXAMINATION

 

Spring 2010

CS201- Introduction to Programming

 

Question No: 27  ( Marks: 2 )

 

What is the difference between switch statement and if statement.

Answer:

 

1.if statement is used when we have to check two conditions while switch is a multi conditional control statement

 

2. SWITCH statement can be executed with all cases if the “break” statement is not used whereas IF statement has to be true to be executed further.

 

Question No: 28  ( Marks: 2 )

 

How can we initialize data members of contained object at construction time?

Answer:

Initializer list is used to initialize the contained objects at the construction time.

 

Question No: 29  ( Marks: 2 )

 

How the data members of a class are initialized with meaningful values?

Answer: Page 334

 

The C++ compiler generates a default constructor for a class if the programmer does not provide it. But the default constructor does not perform any data members initialization. Therefore, it is good practice that whenever you write a class, use a constructor function to initialize the data members to some meaningful values.

 

Question No: 30  ( Marks: 2 )

 

Can we overload NEW and DELETE operators?

Answer: Page 412

 

Yes, it is possible to overload new and delete operators to customize memory management. These operators can be overloaded in global (non-member) scope and in class scope as member operators.

 

Question No: 31  ( Marks: 3 )

 

What will be the output of following functions if we call these functions three times?

 

1)

 

void func1(){ int x = 0; x++;

 

cout << x << endl;

}

 

Answer:

 

1

1

 

 

10

 

 

1

 

2)

 

void func2(){ static int x = 0 ; x++;

 

cout << x << endl ;

}

Answer:

 

1

2

 

3

 

Question No: 32  ( Marks: 3 )

 

What is the keyword ‘this’ and what are the uses of ‘this’ pointer? Answer:

 

‘this’ is use to refer the current class member without using the name of the class.We cannot use it as a variable name. ‘this’ pointer is present in the function, referring to the calling object. this pointer points to the current object.

 

Question No: 33  ( Marks: 3 )

 

Suppose an object of class A is declared as data member of class B.

 

(i)   The constructor of which class will be called first?

 

Answer: A

 

(ii)   The destructor of which class will be called first?

 

Answer: B

 

Question No: 34  ( Marks: 5 )

 

Write the general syntax of a class that has one function as a friend of a class along with definition of friend function.

 

Answer:

 

class frinedclass{ public:

 

friend int compute(exforsys e1) };

 

Int compute(exforsys e1)

 

{

 

//Friend Function Definition which has access to private data return int(e1.a+e2.b)-5;

 

}

 

Question No: 35  ( Marks: 5 )

 

Write down the disadvantages of the templates.

Answer: Repeated

 

Question No: 36  ( Marks: 5 )

 

Write a program which defines five variables which store the salaries of five employees, using setw and

 

 

 

11

 

 

setfill manipulators to display all these salaries in a column.

 

Note: Display all data with in a particular width and the empty space should be filled with character x

 

Output should be displayed as given below: xxxxxx1000

xxxxxx1500

xxxxx20000

 

xxxxx30000

xxxxx60000

Answer:

 

#include <iostream.h> #include <iomanip.h> main(){

 

int sal1 =1000; int sal2 =1500; int sal3 =20000; int sal4 =30000; int sal5 =60000;

cout << setfill (‘x’) << setw (10); cout<< sal1<<endl;

 

cout << setfill (‘x’) << setw (10); cout<< sal2<<endl;

cout << setfill (‘x’) << setw (10); cout<< sal3<<endl;

 

cout << setfill (‘x’) << setw (10); cout<< sal4<<endl;

cout << setfill (‘x’) << setw (10); cout<< sal5<<endl;

int i=0;

 

cin>>i; // to stop the screen to show the output

}

 

 

 

 

FINALTERM EXAMINATION

 

Spring 2009

CS201- Introduction to Programming (Session – 1)

 

Question No: 31  ( Marks: 1 )

 

What is the use of reference data type?

Answer:-

 

A reference data type is a variable that can contain an address. The reference data types in Java are arrays, classes and interfaces. You’ll hear often say that Java does not have pointers. Yet, you could consider a reference data type to be a pointer

 

Question No: 32  ( Marks: 1 )

 

What are the main types of operators in terms of number of arguments they take?

Answer:-

 

The difference is in the number of arguments used by the function. In the case of binary operator overloading, when the function is a member function then the number of arguments used by the operator

 

 

 

12

 

 

member function is one (see below example). When the function defined for the binary operator overloading is a friend function, then it uses two arguments. (not sure)

 

Question No: 33  ( Marks: 2 )

 

What is the this pointer? Give an example of its use

 

Answer:-

 

This pointer is use to points to the current object in programming.

 

In a C++ program, if you create object A of class X, you can then obtain the address of A by using the “this” pointer. The address is available as a local variable in the non-static member functions of X, and its type is const X*. The “this” pointer works because C++ creates instances of its data members, and it keeps one copy of each member function.

 

 

 

Question No: 34  ( Marks: 2 )

 

What are manipulators? Give one example.

Answer:-repeated

 

Question No: 35  ( Marks: 3 )

 

What will be the output of following functions if we call these functions three times?

 

1)

 

void func1(){ int x = 0; x++;

 

cout << x << endl;

}

 

Output will be: 1 1 1

 

 

 

 

2)

 

void func2(){ static int x = 0 ; x++;

 

cout << x << endl ;

}

 

Output will be: 1 2 3

 

 

 

 

Question No: 36  ( Marks: 3 )

 

If the requested memory is not available in the system then what does calloc/malloc and new operator return?

 

Answer:-

 

 

 

13

 

 

malloc returns a void pointer to the allocated space or NULL if there is insufficient memory available. To return a pointer to a type other than void, use a type cast on the return value. The storage space pointed to by the return value is guaranteed to be suitably aligned for storage of any type of object. If size is 0, malloc allocates a zero-length item in the heap and returns a valid pointer to that item.

 

By default, malloc does not call the new handler routine on failure to allocate memory. You can override this default behavior so that, when malloc fails to allocate memory, malloc calls the new handler routine in the same way that the new operator does when it fails for the same reason.

 

 

Question No: 37  ( Marks: 3 )

 

If we want to send the data by reference and don’t want that original data should be affected then what can we do to prevent any change?

 

 

Question No: 38  ( Marks: 5 )

 

Write down the disadvantages of the templates.

Answer:-repeated

 

Question No: 39  ( Marks: 5 )

 

The following code segment has errors. Locate as many as you can and explain briefly.

 

class Circle // no need to enter colon here , so I removed it

 

{

private : //colon missing double centerX; double centerY; double radius;

 

public: //colon missing

void setCenter(double, double); void setRadius(int);

 

};//semi colon missing

 

 

 

 

Question No: 40  ( Marks: 10 )

 

Write a program which consists of two classes, Date and Person.

Date class should contain three data members day, month, year and setter and getter function for these data members. Date class should also contain showdate() member function to display date.

 

Person class should contain three data members Name, Address, and Bday, where Name and Address are char pointer while Bday(Date of birth) is of type Date, Person class should further contain two member functions Display() and setdate().

 

In main program Create an object of Class person and call the member functions with it. ANSWER:

 

#include <stdio.h> #include <iostream> #include <cstring> using namespace std;

 

 

14

 

 

class Date

 

{

public:

int day; int month; int year;

 

public:

 

Date()

{

day=0;

 

month=0;

year=0;

 

}

 

void setDay(int); void setMonth (int); void setYear(int);

 

int getDay(); int getMonth(); int getYear();

 

void showDate();

 

};

void Date: :setDay(int d)

{

if{d<1 | | d>31)

 

cout<<“Invalid month Renter it”; cin>>d;

}

day=d;

 

}

 

void Date: :setMonth (int m)

 

{

if(m<1 | | m>12)

{

cout<<“Invalid month Renter it”; cin>>m;

}

 

month=m;

}

void Date: :setYear (int y)

{

 

year=y;

 

int Date: :getDay()

 

{

 

 

 

15

 

 

return day;

 

}

int Date: :getMonth()

{

return month:

}

int Date: :getYear()

 

{

return year;

}

void Date: :showDate()

 

{

cout<<day<<“-“<<month<<“-“<<year<<end1;

}

Class Person

 

{

public:

 

char *Name; char *Address

 

Date Bday;

 

public:

 

Student()

{

Name=new char[20]; Address=new char[10]; cin.getline(Name,20); cout<<“Enter Address:”; cin.getline(Address,10);

}

 

void setDate()

 

{

cout<<“Enter Day:”; cin>>Ad_date.day; cout<<“Enter month:”; cin>>Ad_date.month; cout<<“Enter Year:”; cin>>Ad_date.year;

}

void Display()

 

{

cout<<“Name: “<<end1; cout<<“Address: “<<Address<<end1; cout<<“Date of Birth: “; Ad-date.showDate();

}

};

void main()

 

 

 

16

 

 

{

 

Person object; object.setDate();

 

object.Display();

 

system(“pause”);

 

}

 

Question No: 41  ( Marks: 10 )

 

Write a C++ program that contains a class ‘myClass’ having two data members of type int. The class must have

 

  • A default constructor which must initialize all the data members to their meaningful values.
  • A destructor with no implementation.
  • Setter member functions to set all data members of class

 

  • Getter member functions to get all data members of class

 

In main function of the program

 

  1. Prompt the user to enter the number of objects to be created.

 

  1. Dynamically allocate memory to objects according to the size entered by user.
  2. De-allocate memory that was allocated to objects

 

Answer:

 

#include <stdio.h> #include <iostream> #include <cstring> using namespace std;

 

class myclass

 

{

 

public: int a; int b;

 

int *iptr, *sptr;

 

construct{int,int.int}

 

void seta(int); void setb(int); void setc(int);

 

int geta(); int getb(); int getc();

 

 

 

 

 

 

17

 

 

};

 

void Person: :seta(int aa)

 

{

 

a=aa;

 

}

 

void Person: :setb (int bb)

 

{

 

b=bb;

 

}

void Person: :setc (int cc)

 

{

c=cc;

}

 

main()

 

{

 

int num;

 

cout<<“Enter the number of objects to be created”;

 

cin>>num;

 

for (int i =1;i==num;i++)

 

{

 

Person i_

 

}

 

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 18

 

 

VU CS201- Introduction To Programming FinalTerm Solved Unsolved Past Papers Fall 2011

ALL NEW RESULTS
Educational News

Updated Educational News

Categories
POSTS BY DATE
December 2016
M T W T F S S
« Sep    
 1234
567891011
12131415161718
19202122232425
262728293031