V Sem Solution Bank
V Sem Solution Bank
V Sem Solution Bank
10 Solution Bank
15 Solution Bank
Sl.No Details Page No.
25 Solution Bank
EVALUATION FORM
FEED BACK
SOLUTION BANK
Text Books:
1.Stallings, “Data and Computer Communications”, 7thEdition,Pearson Education, 2012
Reference Books:
1. Andrew S Tanenbaim, “Computer Networks”, 4th Edition, Pearson Education.
2. BehrouzFerouzan, Introduction to Data Communication & Networking TMH, 1999. 3.
Larry &Peterson & Bruce S Davis; Computer networks Second Edition , Morgan
Kaufman, 2000.
Encoding 1 1
1
Transmission Media 1
II Multiplexing 1 1
Error Detection And
1 1
Correction
Peer to Peer Protocols 1 1
III Medium Access Control 1
1 1
Protocols
1
IV Local Area Networks 1 1
Packet Switching 1
V Networks and 1 1
Congestion Control
5 2
TOTAL 12 8
SECTION – A (2 Marks)
UNIT-III
[Nov / Dec 2016]
1. Expand HDLC and PPP?
2. What is framing?
SECTION – A (2 Marks)
UNIT-V
[Nov / Dec 2016]
1. What is Ethernet?
2. What is meant by choke pocket?
3. What are the two types of LAN standards?
[Nov / Dec 2017]
4. What is flooding?
5. What is Ethernet?
[Nov / Dec 2018]
6. What do you mean by IEEE 802.11 standards?
7. What do you mean by flooding? Explain.
8. What is the difference between Ethernet and fast Ethernet?
[TMAQ – Important Tutor Mark Assignment Questions]
1. Explain different types of bridges.
2. Define routing.
3. What is bridge?
4. What is hierarchical routing?
5. What is fragmentation?
SECTION – B (10 Marks)
UNIT-I
[Nov / Dec 2016]
1. Explain types of transmission modes?
2. Compare mesh topology with star topology?
6. Differentiate datagrams with virtual circuits.
[Nov / Dec 2017]
7. Explain packet switching.
8. Explain Shannon capacity.
7. Illustrate the use of function overloading with example.
[Nov / Dec 2018]
14. Explain circuit switching.
15. How many layers are there in TCP\IP model? Mention the function of each layer.
[Nov /Dec2017]
3.What is multiplexing? Explain TDM
4. Differentiate connectionless and connection oriented services.
SECTION – B ( 10 Marks )
UNIT-V
[Nov / Dec 2016]
1. Explain the following (a) congestion control.
[Nov / Dec 2017]
1. Describe FDDI
2. Write Bellman Ford Algorithm.
[Nov / Dec 2018]
3.Explain the role of the following network devices:
2.Describe FDDI.
5. Define SNR?
SNR is ratio of the signal power to the noise power
SNR= Average signal power
Average noise power
6. What is modem?
Modem is abbreviation for Modulator – Demodulator. Modems are used for data transfer
from one computer network to another computer network through telephone lines.
7. What is FTP?
FTP is application protocol used to transfer a file from one computer to another .it is intended
to operate across different computers even when they are running different operating system.
8. What do you mean by IP utility? Give an ex.
IP provides several handy tools or utilities for troubleshooting, investigating, and analyzing
the network
Examples:
➢ PING
➢ TRACE ROUTE.
a) An analog signal is a continuous wave that a)A digital signal is a discrete wave that
changes over a time period. carries information in binary form
b) An analog signal is represented by a sine b) A digital signal is represented by square
wave. waves.
1. Simplex Mode
2. Half duplex Mode
3. Full duplex Mode
Simplex mode : In this type of transmission mode, data can be sent only in one direction
i.e. communication is unidirectional. We cannot send a message back to the sender.
Unidirectional communication is done in Simplex Systems where we just need to send a
command/signal, and do not expect any response back.
Examples of simplex Mode are loudspeakers, television broadcasting, television and
remote, keyboard and monitor etc.
Half duplex mode : Half-duplex data transmission means that data can be transmitted
in both directions on a signal carrier, but not at the same time
Full duplex mode : In full duplex system we can send data in both the directions as it is
bidirectional at the same time in other words, data can be sent in both directions
simultaneously.
2. Compare mesh topology with star topology?
Mesh topology Star topology
It contains at least two nodes with two The peripheral nodes are connected to
or more paths between them. the central node(ex. hub, switch or
router).
Information is directly routed from one All the information is routed from the
device to another. central network connection.
Expensive due to extensive cabling. Cost is Comparatively less
Quite complex Simple0
Highly robust Intermediate
Advantages:
• Data is transmitted without delays.
• This method suitable for long continuous transmission.
Disadvantages:
• Long connection establishment delay
• Network does not provide flow control or error control.
7. How many layers are there in TCP\IP model? Mention the function of each layer.
TCP/IP means Transmission Control Protocol and Internet Protocol. It is the network
model used in the current Internet architecture as well. Protocols are set of rules which
govern every possible communication over a network. These protocols describe the
movement of data between the source and destination or the Internet. These protocols offer
simple naming and addressing schemes. TCP/IP that is Transmission Control Protocol and
Internet Protocol was developed by Department of Defence Project Research Agency
(ARPA, later DARPA) as a part of a research project of network interconnection to
connect remote machines
Host-to-network layer
• Lowest layer of the all.
• Protocol is used to connect to the host, so that the packets can be sent over it.
• Varies from host to host and network to network. It is equivalent to the combination
of physical and datalink layer.
Internet layer
• Selection of a packet switching network which is based on a connectionless
internetwork layer is called a internet layer.
• It is the layer which holds the whole architecture together.
• It helps the packet to travel independently to the destination.
• Order in which packets are received is different from the way they are sent.
• IP (Internet Protocol) is used in this layer.
Transport layer
• It decides if data transmission should be on parallel path or single path.
• Functions such as multiplexing, segmenting or splitting on the data is done by
transport layer.
• The applications can read and write to the transport layer.
• Transport layer adds header information to the data.
• Transport layer breaks the message (data) into small units so that they are
handled more efficiently by the network layer. Transport layer also arrange the
packets to be sent, in sequence.
Application layer
• TELNET is a two-way communication protocol which allows connecting to a
remote machine and run applications on it.
• FTP (File Transfer Protocol) is a protocol, that allows File transfer amongst
computer users connected over a network. It is reliable, simple and efficient.
• SMTP (Simple Mail Transport Protocol) is a protocol, which is used to transport
electronic mail between a source and destination, directed via a route.
• DNS (Domain Name Server) The Domain Name System (DNS) is a hierarchical
decentralized naming system for computers, services, or other resources
connected to the Internet or a private network.
•
8. Explain concept of checksum?
• A checksum is an error-detection method the transmitter computes a numerical
value according to the number of set or unset bits in a message and sends it along
with each message frame.
• At the receiver end, the same checksum function (formula) is applied to the message
frame to retrieve the numerical value. If the received checksum value matches the
sent value, the transmission is considered to be successful and error free. A
checksum may also be known as a hash sum.
• A mismatched checksum shows that the entire message has not been transmitted.
TCP/IP and User Datagram Protocol (UDP) provide a checksum count as one of
their services.
• The procedure of generating checksums from messages is called a checksum
function and is performed using a checksum algorithm. Efficient checksum
algorithms produce different results with large probabilities if messages are
corrupted. Parity bits and check digits are special checksum cases suitable for tiny
blocks of data. Certain error-correcting codes based on checksums are even capable
of recovering the original data.
9. Explain types of errors?
• Whenever bits flow from one point to another, they are subject to unpredictable
changes because of interference. This interference can change the shape of the
signal.
There are three types of errors.
1.single bit
2.multiple bit
3.burst error
• The term single-bit error means that only 1 bit of a given data unit (such as a byte,
character, or packet) is changed from 1 to 0 or from 0 to 1.
• The following figure shows the effect of a single-bit error on a data unit. To
understand the impact of the change, imagine that each group of 8 bits is an ASCII
character with a 0 bit added to the left. In the figure 00000010 (ASCII STX) was
sent, meaning start of text, but 00001010 (ASCII LF) was received, meaning line
feed.
Burst Error:
The term burst error means that 2 or more bits in the data unit have changed from 1 to
0 or from 0 to 1.The following figure shows the effect of a burst error on a data unit. In
this case, 0100010001000011 was sent, but 0101110101100011 was received. Note that a
burst error does not necessarily mean that the errors occur in consecutive bits. The
length of the burst is measured from the first corrupted bit to the last corrupted bit.
Some bits in between may not have been corrupted.
Multiple bit error: multiple bit error means that two or more non-consecutive bits in
the data unit have changed from 1 to 0 or from 0 to 1
10. What is multiplexing? Explain TDM
• Multiplexing is the set of techniques that allows the simultaneous transmission of
multiple signals across a single data link.
TDM (Time division multiplexing)
• Time-division multiplexing (TDM) is a method of putting multiple data streams in a
single signal by separating the signal into many segments, each having a very short
duration. ... The composite signal thus contains data from multiple senders.
• Time-division multiplexing is used primarily for digital signals, but may be applied
in Analog multiplexing in which two or more signals or bit streams are transferred
appearing simultaneously as sub-channels in one communication channel, but are
physically taking turns on the channel.
Connection-oriented service is
preferred by long and steady Connection-less Service is preferred by
2.
communication. bursty communication.
Connection-oriented Service is
3.
necessary. Connection-less Service is not compulsory.
4.
Connection-oriented Service is feasible. Connection-less Service is not feasible.
Connection-oriented Service gives the Connection-less Service does not give the
6.
guarantee of reliability. guarantee of reliability.
Advantages
• Cheapest form of cable available for networking purposes.
• Easy to handle and install.
13. Explain 2-dimensional parity check for error detection.
• When a large amount of data is to be transmitted two dimensional parity checks can be
employed. In this method, the data words are arranged one above another and is
organized in a form of two dimensional binary matrix. For each row and column of the
matrix parity-check bit is calculated.
• A message consisting of n characters with 8-bits per character will now become n+1
character with 9-bits per character and is transmitted.
• The whole matrix is then sent to the receiver. At the receiver end, the sum of the bits in
the block of data is added again, and if the calculated sum is different than what was
transmitted, then an error is indicated. Then the original block must be transmitted or
written again. This scheme can detect up to three errors that occur anywhere in the
table.
1100111 1
Row
1011101 1
parities
0111001 0
0101001 1
0101010 1 column parities
Connection-oriented service is
preferred by long and steady Connection-less Service is preferred by
2. communication. busty communication.
Connection-oriented Service is
4. feasible. Connection-less Service is not feasible.
Connection-oriented Service gives the Connection-less Service does not give the
6. guarantee of reliability. guarantee of reliability.
FRAME FIELDS
FLAG
• The flag field of an HDLC frame is an 8-bit sequence with the bit pattern
01111110, same as PPP flag field which indicates the beginning and end of the
frame.
ADDRESS
• The second field of an HDLC frame contains the address of the secondary
station. If a primary station created the frame, it contains a to address. If a
secondary creates the frame, it contains a from address.
CONTROL
• The control field is used for flow and error control. It also determines the type of
the frame
INFORMATION FIELD
• The information field contains the user’s data from the network layer or
management information.
FCS FIELD:
• The frame check sequence is the HDLC error detection field. It contains either a
2 or 4-byte CRC
16. Illustrate CSMA
Carrier Sense Multiple Access with collision avoidance(CSMA/CA) was invented for
this network. Collisions are avoided through the use of three CSMA/CA strategies:
✓ Interface space(IFS): In this method when a station senses the channel id idle, it
does not send immediately. It waits for a period of time called the Inter-frame
space. Even though the channel may appear idle when it is sensed, a distant
station may have already started transmitting.
✓ Contention Window: The contention window is an amount of time divided into
slots. A station that is ready to send chooses a random number of slots as its
wait time. The number of slots in the window changes according to the binary
exponential back-off strategy
✓ Acknowledgement: With all these precautions, there may be collision resulting
in destroyed data. The positive acknowledgement and the time-out timer can
help the receiver has received the frame.
17. Describe FDDI
• FDDI uses dual-ring architecture with traffic on each ring flowing in opposite
directions. The dual rings consist of a primary and a secondary ring. During normal
operation, the primary ring is used for data transmission, and the secondary ring
remains idle. When the frames are transmitted through the primary ring at each and
every station the destination address is checked, if it matches then it stops at the
destination else will be transferred through the ring again until exact address is
matched got. If there is any break in the ring, unlike Token-Ring, the frame takes
opposite direction of flow and is transmitted on the secondary ring.
Then the shortest distance according to Bellman ford algorithm from node 2 to
destination node 6 is through node 4.
Example
Let us understand the algorithm with following example graph. The images are taken
from this source.
Let the given source vertex be 0. Initialize all distances as infinite, except the distance to
source itself. Total number of vertices in the graph is 5, so all edges must be processed 4
times.
Let all edges are processed in following order: (B, E), (D, B), (B, D), (A, B), (A, C), (D,
C), (B, C), (E, D). We get following distances when all edges are processed first time.
The first row in shows initial distances. The second row shows distances when edges (B,
E), (D, B), (B, D) and (A, B) are processed. The third row shows distances when (A, C) is
processed. The fourth row shows when (D, C), (B, C) and (E, D) are processed.
The first iteration guarantees to give all shortest paths which are at most 1 edge long.
We get following distances when all edges are processed second time (The last row
shows final values).
The second iteration guarantees to give all shortest paths which are at most 2 edges
long. The algorithm processes all edges 2 more times. The distances are minimized after
the second iteration, so third and fourth iterations don’t update the distances.
19. Explain the role of the following network devices:
• Hub
• Switch
• Bridge
• Router
• Repeater
• Hub – A hub is basically a multiport repeater. A hub connects multiple wires
coming from different branches, for example, the connector in star topology which
connects different stations. Hubs cannot filter data, so data packets are sent to all
connected devices.
• Switch – A switch is a multiport bridge with a buffer and a design that can boost its
efficiency (large number of ports imply less traffic) and performance. Switch is data
link layer device. The switch can perform error checking before forwarding data,
that makes it very efficient as it does not forward packets that have errors
and forward good packets selectively to correct port only.
• Bridge – A bridge operates at data link layer. A bridge is a repeater, with add on
functionality of filtering content by reading the MAC addresses of source and
destination.
• Routers – A router is a device like a switch that routes data packets based on their
IP addresses. Router is mainly a Network Layer device. Routers normally connect
LANs and WANs together and have a dynamically updating routing table based on
which they make decisions on routing the data packets. Router divide broadcast
domains of hosts connected through it.
• Repeater – A repeater operates at the physical layer. Its job is to regenerate the
signal over the same network before the signal becomes too weak or corrupted so as
to extend the length to which the signal can be transmitted over the same network.
An important point to be noted about repeaters is that they do not amplify the
signal. When the signal becomes weak, they copy the signal bit by bit and regenerate
it at the original strength. It is a 2 port device.
Section-C
1. A) Explain the types of network?
LAN
• LAN refers to a group of computers that all belong to the same organization and that
are linked within a small geographic area using a network and often the same
technology (the most widespread being Ethernet).
• A local area network is a network in its simplest form. Data transfer speeds over a local
area network can reach up to 10 Mbps, such as for an Ethernet network, and 1 gbps, as
with FDDI or Gigabit Ethernet. A local area network can reach as many as 100, or even
1000, users. MAN
• MANs connect multiple geographically close LANs (over an area of up to several dozen
miles) to one another at high speeds. Thus, a MAN lets two remote nodes communicate
as if they were part of the same local area network.A MAN is made from switches or
routers connected to one another with high-speed links (usually fibre optic cables).
WANs
• A WAN connects multiple LANs to one another over great geographic distances. The
speed available on a WAN varies depending on the cost of the connections, which
increases with distance, and may be low.WANs operate using routers, which can
"choose" the most appropriate path for data to take to reach a network node.
The most well-known WAN is the Internet.
b) Explain OSI reference model with a neat diagram. Repeated [Nov-Dec 2018]
Layer 1: The Physical Layer
• A signal is pulse code modulated to convert its analog information into a binary
sequence, i.e., 1s and 0s. The output of a PCM will resemble a binary sequence. The
following figure shows an example of PCM output with respect to instantaneous values
of a given sine wave.
• Instead of a pulse train, PCM produces a series of numbers or digits, and hence this
process is called as digital. Each one of these digits, though in binary code, represent
the approximate amplitude of the signal sample at that instant.
• In Pulse Code Modulation, the message signal is represented by a sequence of coded
pulses. This message signal is achieved by representing the signal in discrete form in
both time and amplitude.
B) SONET
• Synchronous Optical Networking (SONET) and Synchronous Digital Hierarchy
(SDH) are standardized multiplexing protocols that transfer multiple digital bit streams
over optical fiber using lasers or light-emitting diodes (LEDs). Lower data rates can also
be transferred via an electrical interface. The method was developed to replace the
Plesiochronous Digital Hierarchy (PDH) system for transporting larger amounts of
telephone calls and data traffic over the same fiber without synchronization problems.
SONET generic criteria are detailed in Telcordia Technologies Generic Requirements
document GR-253-CORE.Generic criteria applicable to SONET and other transmission
systems (e.g., asynchronous fiber optic systems or digital radio systems) are found in
Telcordia GR-499-CORE.
• SONET and SDH, which are essentially the same, were originally designed to transport
circuit mode communications (e.g., DS1, DS3) from a variety of different sources, but
they were primarily designed to support real-time, uncompressed, circuit-switched
voice encoded in PCM format.The primary difficulty in doing this prior to
SONET/SDH was that the synchronization sources of these various circuits were
different. This meant that each circuit was actually operating at a slightly different rate
and with different phase. SONET/SDH allowed for the simultaneous transport of many
different circuits of differing origin within a single framing protocol. SONET/SDH is
not itself a communications protocol per se, but a transport protocol.
Co-coaxial cable
• Coaxial cable is a type of copper cable specially built with a metal shield and other
components engineered to block signal interference. It is primarily used by cable TV
companies to connect their satellite antenna facilities to customer homes and businesses.
It is also sometimes used by telephone companies to connect central offices to telephone
poles near customers. Some homes and offices use coaxial cable, too, but its widespread
use as an Ethernet connectivity medium in enterprises and data centres has been
supplanted by the deployment of twisted pair cabling.
5. Illustrate polynomial code with an example.Repeated [Nov-Dec 2018]
Polynomial codes are used extensively in error detection and correction. Polynomial codes can
be easily implemented using shift-register circuits. A k-bit data-word can be represented as a
polynomial with k terms ranging from x k-1 to x0 as
I(x)= ik-1xk-1 + ik-2 xk-2 +………….+i1 x +I0 .
For example, let’s take a 8-bit message 10011010. The corresponding polynomial is
represented
M(x) = 1.x7 +0.x6 + 0.x5 +1.x4 + 1.x3 + 0.x2 + 1.x1 + 0.x0
=x7 + x4 + x3+ x1
•
• Polynomial codes involve generating check bits in the form of a cyclic redundancy
check(CRC). For these reasons they are also known as CRC codes.
• When applying the CRC method, both the sender and the receiver must agree upon a
common generator polynomial G(x). To compute the checksum for frame with M bits,
corresponding to the polynomial M(x), the frame M must be longer than the generator
polynomial. The polynomial M(x)is divided by G(x) to generate checksum. The
checksum, is appended at the end of the frame, in such a way that the transmitted
polynomial is completely divisible by G(x). if there is no remainder, it indicates no
transmission error.
• The most common CRC is the CCITT CRC-16 and CRC-32 used for many today’s
applications.
CRC-16=X16+X15+X2+1
CRC-CCITT=X16+X12+X5+1
CRC-32=X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+1
• Electrical noise going into or coming from the cable can be prevented.
• Crosstalk is minimize.
• Cheapest form of cable available for networking purposes.
• Easy to handle and install.
DISADVANTAGES
• It is incapable carrying a signal over long distances without the use of repeaters only
because of high attenuation.
• It is not suitable for broadband applications only because of its low bandwidth capabilities
8.Explain SONET.
Synchronous optical networking (SONET) is a standardized digital communication protocol
that is used to transmit a large volume of data over relatively long distances using a fiber optic
medium. With SONET, multiple digital data streams are transferred at the same time over
optical fiber using LEDs and laser beams.
PHYSICAL CONFIGURATION
1. STS Multiplexer:
• Performs multiplexing of signals
• Converts electrical signal to optical signal
2. STS De-multiplexer:
• Performs de-multiplexing of signals
• Converts optical signal to electrical signal
3. Regenerator:
It is a repeater, that takes an optical signal and regenerates (increases the strength) it.
4. Add/Drop Multiplexer:
It allows to add signals coming from different sources into a given path or remove a
signal.
10. Explain optical fibre as transmission medium
• Optical fibre transmission systems were introduced in 1970. It offered greater advantages
over copper based digital transmission systems.
• A thin flexible fibre with a glass core through which light signals can be sent.
• Fibre optic cable has the ability to transmit signals over much longer distances.
• Optical fibre are immune to interference and cross talk
• A fibre optic cable is made of centre glass core surrounded by a concentric layer of
glass(cladding).
• The information is transmitted thru the glass core in the form of light.
• An important characteristic of fibre optic is refraction. Refraction is the characteristic of a
material to either pass or reflect the light. When a light passes thru the medium, it bends as it
passes from one medium to another.
•Wave length Division Multiplexing is an effective approach to explore the bandwidth that is
available in optical fibre. In WDM multiple wave length are used to carry several information
simultaneously over the same fibre.
Advantages
• It supports higher bandwidth
• It runs greater distance.
• Electromagnetic noise cannot affect fibre optic cables
• Usage of glass makes more resistant than copper
Disadvantages
• Installation and maintenance is difficult.
• Unidirectional light propagation. Two fibres are used for bidirectional propagation
• The cable and the interfaces are more expensive.
11. Explain the following?
a) CRC method
• Error detection mechanism in which a special number is appended to a block of data in
order to detect any changes introduced during storage (or transmission). The CRe is
recalculated on retrieval (or reception) and compared to the value originally
transmitted, which can reveal certain types of error. For example, a single corrupted bit
in the data results in a one-bit change in the calculated CRC, but multiple corrupt bits
may cancel each other out.
• A CRC is derived using a more complex algorithm than the simple CHECKSUM,
involving MODULO ARITHMETIC (hence the 'cyclic' name) and treating each input
word as a set of coefficients for a polynomial.
• CRC is more powerful than VRC and LRC in detecting errors.
• It is not based on binary addition like VRC and LRC. Rather it is based on binary
division.
• At the sender side, the data unit to be transmitted IS divided by a predetermined
divisor (binary number) in order to obtain the remainder. This remainder is called
CRC.
• The CRC has one bit less than the divisor. It means that if CRC is of n bits, divisor is of
n+ 1 bit.
• The sender appends this CRC to the end of data unit such that the resulting data unit
becomes exactly divisible by predetermined divisor i.e. remainder becomes zero.
• For example, if data to be transmitted is 1001 and predetermined divisor is 1011. The
procedure given below is used:
2. During this process of division, whenever the leftmost bit of dividend or remainder is 0, we
use a string of Os of same length as divisor. Thus in this case divisor 1011 is replaced by 0000.
Characteristics
• Used in Connection-oriented communication.
• It offers error and flow control
• It is used in Data Link and Transport Layers
• Stop and Wait ARQ mainly implements Sliding Window Protocol concept with Window
Size 1
Useful Terms:
• Propagation Delay: Amount of time taken by a packet to make a physical journey from
one router to another router.
Propagation Delay = (Distance between routers) / (Velocity of propagation)
• RoundTripTime (RTT) = 2* Propagation Delay
• TimeOut (TO) = 2* RTT
• Time To Live (TTL) = 2* TimeOut. (Maximum TTL is 180 seconds)
Simple Stop and Wait
Sender:
Receiver:
Rule 1) Send acknowledgement after receiving and consuming of data packet.
Rule 2) After consuming packet acknowledgement need to be sent (Flow Control).
12. Describe selective repeat ARQ.
Selective repeat protocol, also called Selective Repeat ARQ (Automatic Repeat reQuest), is a
data link layer protocol that uses sliding window method for reliable delivery of data frames. ...
The size is half the maximum sequence number of the frame
• To support Go-Back-N ARQ, a protocol must number each PDU which is sent. (PDUs
are normally numbered using modulo arithmetic, which allows the same number to be
re-used after a suitably long period of time. The time period is selected to ensure the
same PDU number is never used again for a different PDU, until the first PDU has "left
the network" (e.g. it may have been acknowledged)).
• The local node must also keep a buffer of all PDUs which have been sent, but have not
yet been acknowledged.
• The receiver at the remote node keeps a record of the highest numbered PDU which has
been correctly received. This number corresponds to the last acknowledgement PDU
which it may have sent.
BASIS FOR
HDLC PPP
COMPARISON
Dynamic addressing Does not offer dynamic addressing. Dynamic addressing is used.
Compatibility with other Can not be operated with non-Cisco Interoperable with non-Cisco
protocols devices. devices also.
Unit 4
16 .a) Write short notes on ALOHA protocol.
Aloha means "Hello". Aloha is a multiple access protocol at the datalink layer and
proposes how multiple terminals access the medium without interference or collision.
Pure ALOHA
• In pure ALOHA, the stations transmit frames whenever they have data to send.
• When two or more stations transmit simultaneously, there is collision and the frames
are destroyed.
Slotted ALOHA
• Slotted ALOHA was invented to improve the efficiency of pure ALOHA as chances of
collision in pure ALOHA are very high.
• In slotted ALOHA, the time of the shared channel is divided into discrete intervals
called slots.
• The stations can send a frame only at the beginning of the slot and only one frame is
sent in each slot.
b) Explain CSMA protocols.
o CSMA is a network access method used on shared network topologies such as Ethernet to
control access to the network. Devices attached to the network cable listen (carrier sense)
before transmitting. If the channel is in use, devices wait before transmitting. MA (Multiple
Access) indicates that many devices can connect to and share the same network. All devices
have equal access to use the network when it is clear.
CSMA works on the principle that only one device can transmit signals on the network,
otherwise a collision will occur resulting in the loss of data packets or frames. CSMA works
when a device needs to initiate or transfer data over the network. Before transferring, each
CSMA must check or listen to the network for any other transmissions that may be in
progress. If it senses a transmission, the device will wait for it to end. Once the transmission is
completed, the waiting device can transmit its data/signals. However, if multiple devices access
it simultaneously and a collision occurs, they both have to wait for a specific time before
reinitiating the transmission process.
17.Explain FDMA, TDMA and CDMA
• Frequency division multiple access(FDMA): In FDMA, the available bandwidth of the
channel is divided into frequency bands and each frequency band is allocated to different
stations. Each station on demand is allocated a predetermined band to send its all the time.
To prevent station interference the allocated bands are separated from one another by
small guard bands.
• Time division multiple access (TDMA) : In TDMA, the stations take turns to share the
entire bandwidth of the channel. Each station is allocated a time slot during which it can
transmit data for the complete bandwidth. Since TDMA transmissions are slotted, the
receiver must be synchronized with the sender. Each station needs to know the beginning of
its slot and the location of its slot for transmission.
• Code division multiple access(CDMA): In TDMA and FDMA data transmission from
different stations are clearly separated either by time or by frequency. Code division
multiple access is a digital wireless technology that uses spread spectrum techniques.
CDMA does not assign a specific frequency to each user. Instead, every station uses the full
available spectrum.
18.Explain ALOHA and slotted ALOHA
• ALOHA is a system for coordinating and arbitrating access to a shared communication
Networks channel. It was developed in the 1970s by Norman Abramson and his colleagues
at the University of Hawaii. The original system used for ground based radio
broadcasting, but the system has been implemented in satellite communication systems.
• A shared communication system like ALOHA requires a method of handling collisions
that occur when two or more systems attempt to transmit on the channel at the same time.
• In the ALOHA system, a node transmits whenever data is available to send. If another
node transmits at the same time, a collision occurs, and the frames that were transmitted
are lost. However, a node can listen to broadcasts on the medium, even its own, and
determine whether the frames were transmitted.
• There are two different versions of ALOHA
Pure ALOHA
• In pure ALOHA, the stations transmit frames whenever they have data to send.
• When two or more stations transmit simultaneously, there is collision and the
frames are destroyed.
Slotted ALOHA
• Slotted ALOHA was invented to improve the efficiency of pure ALOHA as
chances of collision in pure ALOHA are very high.
• In slotted ALOHA, the time of the shared channel is divided into discrete
intervals called slots.
• The stations can send a frame only at the beginning of the slot and only one
frame is sent in each slot.
The data link layer is divided into two sublayers namely LLC (Logical Link Control) and MAC
(Media Access Control).
Logical Link Control (LLC) sublayer provides the logic for the data link. Thus, it
controls the synchronization, flow control, and error checking functions of the data link
layer.
Media Access Control (MAC) sublayer provides control for accessing the transmission
medium. It is responsible for moving data packets from one network interface card
(NIC) to another, across a shared transmission medium. Physical addressing is handled
at the MAC sublayer. MAC is also handled at this layer. This refers to the method used
to allocate network access to computers and prevent them from transmitting at the
same time, causing data collisions. Common MAC methods include Carrier Sense
Multiple Access/Collision Detection (CSMA/CD), used by Ethernet networks,
Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA), used by AppleTalk
networks, and token passing, used by Token Ring and Fiber Distributed Data Interface
(FDDI) networks.
Unit 5
21. Explain the following:
a) Dijikstra’s algorithm
o Dijkstra's algorithm is a step-by-step process we can use to find the shortest path
between two vertices in a weighted graph. This algorithm enables us to find
shortest distances and minimum costs, making it a valuable tool.
b) Token bucket algorithm.
• The token bucket algorithm is based on an analogy of a fixed capacity bucket into
which tokens, normally representing a unit of bytes or a single packet of predetermined
size, are added at a fixed rate.
• When a packet is to be checked for conformance to the defined limits, the bucket is
inspected to see if it contains sufficient tokens at that time. If so, the appropriate
number of tokens, e.g. equivalent to the length of the packet in bytes, are removed
("cashed in"), and the packet is passed, e.g., for transmission.
• The packet does not conform if there are insufficient tokens in the bucket, and the
contents of the bucket are not changed. Non-conformant packets can be treated in
various ways:
Algorithm
• A token is added to the bucket every seconds
• The bucket can hold at the most tokens. If a token arrives when the bucket is full, it is
discarded.
• When a packet (network layer PDU) of n bytes arrives,
• if at least n tokens are in the bucket, n tokens are removed from the bucket, and the
packet is sent to the network.
• if fewer than n tokens are available, no tokens are removed from the bucket, and the
packet is considered to be non-conformant.
22. What is a bridge? Explain the various types of bridges.Repeated [Nov-Dec 2018]
• It is type of computer network device that provides interconnection with other bridge
network that uses same protocol
Types of bridges:
• Transparent bridges: The term transparent refers to the fact that stations are
completely unaware of the presence of bridges in the network. When a transparent is
added or removed from the system, reconfiguration of the stations in unnecessary.
• Source Routing Bridges: Source routing bridges were developed by the IEEE 802.5
Committee and are primarily used to interconnect token-ring networks. Unlike
transparent bridges where filtering frames, forwarding and blocking functions are
implemented in bridges, source routing bridges put these burden on the end stations.
The main idea of source routing is that each station should determine the route to the
destination when it wants to send a frame and therefore include the route information
in the header of the frame.
24.Illustrate open-loop congestion control
Open-loop policies, policies are applied to prevent congestion before it happens. In these
mechanisms, congestion control is handled by either the source or destination.
• Admission control: Admission control is a quality-of-service mechanism that computes
the resource requirements of a network flow and determines whether the resources are
available for the flow. If the QoS of the new flow can be satisfied without violating QoS
of existing flow, the flow is accepted; otherwise, the flow is rejected.
• Traffic shaping: one of the main causes of congestion is that traffic is often bursty data.
When a source tries to send packets; it may not know exactly what its traffic flow looks
like. if the source wants to ensure that the traffic flow conforms to the parameters of
QoS, it should alter its traffic flow
25.Explain different types of bridges in computer networks.
There are three types of bridges
1. Transparent bridges: The term transparent refers to the fact that stations are
completely unaware of the presence of bridges in the network. When a transparent is
added or removed from the system, reconfiguration of the stations is unnecessary.
A transparent bridge performs the following 3 basic functions:
A. Forwards frames from one LAN to another
B. Learns where stations are attached to the LAN
C. Prevents loops in the topology
2. Source Routing bridges: It was developed by the IEEE 802.5 committee an are primarily
used to interconnect token ring networks Unlike transparent bridges where filtering
frames, forwarding and blocking functions are implemented in bridges, source routing
bridges put these burden on the end stations. The main idea of this is that reach station
should determine the route to the destination when it wants to send a frame and therefore
include the route information in the header of the frame. thus the problem boils down to
finding good routes efficiently.
The solution is to first find all the paths from source to destination then calculate the
distance for all the route the less distance path will be taken for transferring the frame
from source to destination
As an example, if S1 wants to send a frame to S2, then a possible route is
a. LAN 1 – B1 – LAN 2 – B4 – LAN 4
b. LAN 1 – B2 – LAN 3 – B5 – LAN 4
c. LAN 1 – B2 – LAN 3 – B3 LAN 2 – B4 – LAN 4
d. LAN 1 – B2 – LAN3 – B6 – LAN 5 – B7 LAN 4
2. Mixed Media Bridges: Bridges that interconnect LAN of different type are referred to
as Mixed Media Bridge. This type of interconnection is not simple. Mixed media bridges
can be discussed in terms of the interconnection of Ethernet and token ring LAN. These
two LAN differ in their frame structure, their operation and their speed, and the bridge
needs to take these difference into accounts.
Section D
26. Compare packet switching with circuit switching.
Packet switching Circuit switching
1. Packet switching is connectionless which 1. Circuit switching is a type of networking
means the data is transmitted into small units protocol in which a dedicated channel is
called packets and a dynamic route is established between two end points in a network
established for each pack for the duration of a transmission. Data transfer
takes place after the circuit is established
2.Data is divided into small units called packets 2. A physical path is established which is
with each packet carrying small header dedicated to a single connection between the two
containing signalling information end points.
3.Dynamic route is established for each packet 3. Data transmission takes place after the circuit
which carries the routing information. is established for the duration of the
transmission.
4.Each data packet may take a different route to 4. A dedicated routing path is followed
reach the destination, making it flexible throughout the transmission and no other user
throughout the session. is allowed to use the circuit.
5. There is no end to end reservation of links. 5. It follows a uniform path throughout the
session.
6.Each data packet carries the signalling 6. Data doesn’t carry the signalling information
information containing source and destination and moves on its own.
addresses in the packet header.
7.It’s mainly used for data and voice 7. It’s ideal for voice communication and the
communication, and the delay is not uniform. delay is uniform.
34. Explain TCP/IP model with a neat diagram.
TCP/IP model layers
TCP/IP functionality is divided into four layers, each of which include specific protocols.
• The application layer provides applications with standardized data exchange. Its protocols
include the Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), Post Office
Protocol 3 (POP3), Simple Mail Transfer Protocol (SMTP) and Simple Network
Management Protocol (SNMP).
• The transport layer is responsible for maintaining end-to-end communications across the
network. TCP handles communications between hosts and provides flow control,
multiplexing and reliability. The transport protocols include TCP and User Datagram
Protocol (UDP), which is sometimes used instead of TCP for special purposes.
• The network layer, also called the internet layer, deals with packets and connects
independent networks to transport the packets across network boundaries. The network
layer protocols are the IP and the Internet Control Message Protocol (ICMP), which is
used for error reporting.
• The physical layer consists of protocols that operate only on a link -- the network
component that interconnects nodes or hosts in the network. The protocols in this layer
include Ethernet for local area networks (LANs) and the Address Resolution Protocol
(ARP).
35. Explain OSI reference model in detail.
The model is proposed by the ISO (International Standards Organization). It is called ISO-
OSI (Open Systems Interconnection) Reference Model because it deals with connecting
open systems. The OSI Reference Model has 7 layers.
a. Physical Layer:
• It is concerned with the actual physical attachment to the network i.e. it deals with the
means of connecting two nodes in a network.
• It deals with transmitting raw bits over the communication channel.
• The design issues here deal with mechanical, electrical, timing interfaces and the
physical transmission medium which lies below the physical layer.
b. Data Link Layer:
• It breaks the data into frames and passes it to the network layer. It also does:
• Error Control: To control transmission errors.
• Flow Control: To prevent the drowning of slow receiver by fast transmitter.
• Access Control: Control access to the shared channel. A special section of the DLL
called the Medium Access Control sub layer deals with this.
c. Network Layer:
• It has the responsibility of preforming source to destination delivery of packets. It
focuses on:
• Dynamic routing
• Congestion control
• Quality of service
• Addressing
• Integration of heterogeneous networks.
e. Transport Layer:
• It deals withControl of data flow in the network.
• Ensuring no loss of data.
• Ensuring that destination is not inundated with data.
• Ensuring that all pieces arrive correctly at the other end.
• It is a true end to end layer.
e. Session Layer: Its features are:
• Dialogue Control: Keeping track of whose turn it is to transmit.
• Token management: Preventing two parties from attempting the same critical operation
at the same time.
• Synchronization: Check pointing long transmissions to allow them to continue from
where they were after a crash.
f. Presentation Layer: It is concerned with the following:
• Syntax of information.
• Semantics of information.
• Compression
• Encoding of information.
g. Application Layer: Application layer provide user interface and support for services
like:
• E-mail.
• Remote file access.
• File transfer
• Shared database management.
Advantages of OSI Reference Model:
• OSI Model distinguish between the services, interfaces and protocols.
• Protocols of OSI Model are very well hidden.
• They can be replaced by new protocols as technology changes.
• Supports connection oriented as well as connectionless service.
Disadvantages of OSI Reference Model:
i. Model was devised before the invention of protocols.
ii. Fitting of protocols is a tedious task.
36. Illustrate polar line encoding scheme.
There is a change in the polarity of the signal, only when the incoming signal changes from 1
to 0 or from 0 to 1. It is the same as NRZ, however, the first bit of the input signal should have
a change of polarity.
If a 1 occurs at the incoming signal, then there occurs a transition at the beginning of the bit
interval. For a 0 at the incoming signal, there is no transition at the beginning of the bit
interval.
NRZ codes has a disadvantage that the synchronization of the transmitter clock with the
receiver clock gets completely disturbed, when there is a string of 1s and 0s. Hence, a separate
clock line needs to be provided.
Bi-phase Encoding
The signal level is checked twice for every bit time, both initially and in the middle. Hence, the
clock rate is double the data transfer rate and thus the modulation rate is also doubled. The
clock is taken from the signal itself. The bandwidth required for this coding is greater.
• Bi-phase Manchester
• Differential Manchester
Bi-phase Manchester
In this type of coding, the transition is done at the middle of the bit-interval. The transition for
the resultant pulse is from High to Low in the middle of the interval, for the input bit 1. While
the transition is from Low to High for the input bit 0.
Differential Manchester
In this type of coding, there always occurs a transition in the middle of the bit interval. If
there occurs a transition at the beginning of the bit interval, then the input bit is 0. If no
transition occurs at the beginning of the bit interval, then the input bit is 1.
The following figure illustrates the waveforms of NRZ-L, NRZ-I, Bi-phase Manchester and
Differential Manchester coding for different digital inputs.
a) Modems:Modem is abbreviation for Modulator – Demodulator. Modems are used for data
transfer from on computer network to another computer network through telephone lines. The
computer network works in digital mode, while analog technology is used for carrying
massages across phone lines.
Modulator converts information from digital mode to analog mode at the transmitting end
and demodulator converts the same from analog to digital at receiving end. The process of
converting analog signals of one computer network into digital signals of another computer
network so they can be processed by a receiving computer is referred to as digitizing.
Types of Modems
• Modems can be of several types and they can be categorized in a number of ways.
• Categorization is usually based on the following basic modem features:
1. Directional capacity: half duplex modem and full duplex modem.
2. Connection to the line: 2-wire modem and 4-wire modem.
3. Transmission mode: asynchronous modem and synchronous modem.
b).Congestion control.Congestion is an important issue that can arise in packet switched
network. Congestion is a situation in Communication Networks in which too many packets are
present in a part of the subnet, performance degrades. Congestion in a network may occur
when the load on the network (i.e. the number of packets sent to the network) is greater than
the capacity of the network (i.e. the number of packets a network can handle.). Network
congestion occurs in case of traffic overloading.
38. Explain any routing algorithms.
Routing is process of establishing the routes that data packets must follow to reach the
destination. In this process, a routing table is created which contains information regarding
routes which data packets follow. Various routing algorithm are used for the purpose of
deciding which route an incoming data packet needs to be transmitted on to reach
destination efficiently.
Classification of Routing Algorithms: The routing algorithms can be classified as follows:
1.Adaptive Algorithms –These are the algorithms which change their routing decisions
whenever network topology or traffic load changes. The changes in routing decisions are
reflected in the topology as well as traffic of the network. Also known as dynamic routing,
these make use of dynamic information such as current topology, load, delay, etc. to select
routes. Optimization parameters are distance, number of hops and estimated transit time.
2.Non-AdaptiveAlgorithms–These are the algorithms which do not change their routing
decisions once they have been selected. This is also known as static routing as route to be
taken is computed in advance and downloaded to routers when router is booted.
Further these are classified as follows:
(a) Flooding – Flooding is the static routing algorithm. In this algorithm, every incoming
packet is sent on all outgoing lines except the line on which it has arrived.
(b) Random walk – In this method, packets are sent host by host or node by node to one
of its neighbours randomly. This is highly robust method which is usually implemented
by sending packets onto the link which is least queued.
SOLUTION BANK
Unit - I
Introduction: Software Products and Software process, Process models: Waterfall modal, Evolutionary
Development, Bohemia’s Spiral model, Overview of risk management, Process Visibility,
Professional responsibility. Computer based System Engineering: Systems and their environment,
System Procurement, System Engineering Process, System architecture modelling. Human Factors,
System reliability Engineering. Requirements and Specification: The requirement Engineering
Process, The Software requirement document, Validation of Evolution of requirements, Viewpoint –
oriented & method based analysis , system contexts , Social 7 organizational factors . Data flow ,
Semantic, Objects, models , Requirement Specification, Non functional requirement.[ 12 Hours ]
Unit - II
Software Prototyping: Prototyping in software process, Prototyping techniques, User interface
prototyping. Software Design: Design Process, Design Strategies, Design Quality , System Structuring
control models, Modular decomposition , Domain Specific architecture.[ 12 Hours ]
Unit - III
Object Oriented& function oriented design: Objects, object Classes and inheritance Object
identification, An object oriented design example, Concurrent Objects, Data flow design Structural
decomposition, Detailed Design, A Comparison of design Strategies.User interface design: Design
Principles, User System interaction, Information Presentation, User Guidance, Interface Evaluation.
[ 12 Hours ]
Unit - IV
Software Reliability and reusability : Software reliability metrics , Software reliability Specification ,
Statistical testing ,Reliability Growth modeling, Fault avoidance & tolerance, Exception handling &
defensive programming , Software development with reuse, Software’ development for reuse ,
Generator based reuse, Application System Portability.[ 12 Hours ]
Unit - V
Software Verification and Validation : The testing Process , Test Planning & Strategies, Black Box ,
Structural, interface testing , Program inspections , Mathematically based verification, Static analysis
tools, Clean room software development. Management Issues: Project management, Quality
management, Software cost estimation, Softwaremaintenance. [ 12 Hours ]
Text book
1. Ian Sommerville – Software Engineering, 9th Edition, Pearson Education Ltd, 2010.
Reference Books
1. Roger S. Pressman – Software Engineering, A Practitioner’s approach, 7th Edition,
McGRAW-HILL Publication, 2010.
2. Pankaj Jalote, “An integrated approach to Software Engineering”, 3rd Edition, Narosa
Publishing House, 2013.
BCA502T : SOFTWARE ENGINEERING
BLUE PRINT
Question paper pattern for theory has two sections :
Section – A :Contains 12 questions, out of which a student has to answer 10 questions. Each question
carries 2 marks ( 10 x 2 = 20 )
Section – B :Contains 8 full questions, out of which 5 question to be answered. Each full question
carries 5 marks (5 x 5 = 25)
Section – C :Contains 5 full questions with sub questions(a) & (b), out of which 3 questions to be
answered. Each full question carries 15 marks (3x 15 = 45)
Section – D :Contains 2 full questions, out of which 1 question to be answered. Each full question
carries 10 marks (1 x 10 = 10)
II Software Prototyping 1 1 1
TOTAL 12 8 5
2
ANSWER ANSWER ANSWER ANSWER
ANY 10 ANY 5 ANY 3 ANY 1
10
TOTAL MARKS 20 25
45
SECTION – A ( 2 Marks)
UNIT-I
[ Nov / Dec 2015 ]
1. What is software product ? Name two types of software product.
2. What is the difference between software engineering and system engineering?
3. What is system decommissioning ?
4. Define volatile requirement.
5. What are functional requirement? Give example.
[ Nov / Dec 2016 ]
6. What is customized software product? Give an example.
7. What is COTS?
8. What is feasibility study?
[ Nov / Dec 2017 ]
9. Define system.
10. What are the two types of software products?
11. Define SRS
[ Nov / Dec 2018 ]
12. Define Software engineering?
SECTION – B( 5 Marks)
UNIT-III
[ Nov / Dec 2015 ]
1. Describe any two styles of use interaction
[ Nov / Dec 2016 ]
2. What are the methods of object identification with an example
[ Nov / Dec 2017 ]
3. Explain different phases of user system interaction
[ Nov / Dec 2018 ]
4. Write a short note on Data flow design, structural decomposition.
[ TMAQ - Important Tutor Mark Assignment Questions ]
SECTION – B( 5 Marks)
UNIT-IV
[ Nov / Dec 2015 ]
1. Explain different types of software reliability metrics.
2. What are the different types of interface errors
[ Nov / Dec 2016 ]
3. Write a note on system reliability engineering.
4. Discuss hardware and software reliability metrics.
[ Nov / Dec 2017 ]
5. Give the classification of failures with examples
6. What is fault tolerance? Explain the two approaches of software fault tolerance.
[ Nov / Dec 2018 ]
7. Write a short note on reliability growth modeling.
SECTION – B( 5 Marks)
UNIT-V
[ Nov / Dec 2015 ]
1. Write a note on black box testing
[ Nov / Dec 2016 ]
2. Explain thread testing with a diagram
[ Nov / Dec 2017 ]
3. Difference between Black box and white box testing
[ Nov / Dec 2018 ]
4. Explain the content of test plan
SECTION –C , D & E
UNIT-I
[ Nov / Dec 2015 ]
1. Explain Spiral model with neat diagram. Discuss advantages and disadvantages.
2. Explain requirement elicitation and analysis process.
3. Explain IEEE structure of SRS
4. Write SRS for library system.
[ Nov / Dec 2016 ]
5. Explain water fall model with a neat diagram. Mention its merits and demerits
[ Nov / Dec 2017 ]
6. Explain system engineering process with a neat diagram.
[ Nov / Dec 2018 ]
7. Explain the fundamental process activities involved in SDLC with neat diagram.
UNIT-IV & UNIT V
[ Nov / Dec 2015 ]
1. Explain quality control in detail.
[ Nov / Dec 2016 ]
2. Write a note on Risk management
3. Write a note on COCOMO model.
[ Nov / Dec 2017]
4. Explain different types of software maintenance.
5. Explain the contents of test plan template.
[ Nov / Dec 2018]
1. Explain clean room software development process.
2. Explain software reuse.
3. Explain types of cohesion.
4. Explain function oriented design.
1.Explain waterfall model with its advantages and disadvantages?
Waterfall model was developed by Royce in 1970. this model is also referred as linear
sequential model or classical life cycle model. This model suggests a systematic, sequential
approach to software development that begins at system level and progresses through
analysis, design, development, coding, testing and maintenance.
• The waterfall model requires the user to define system requirements early in the
project.
• This model is rigid because it assumes that a phase is fully complete before another one
commences.in reality two or more phases may proceed in parallel.
• Interaction with the user takes place right in the beginning while firming up
requirements and then at the time of implementation. this leaves a huge gap in-
between phases and does not in any way build a method of cross checking user
requirements.
2. Explain IEEE structure of SRS document.
The IEEE standards recognize the fact that different projects may require their requirements
to be organized differently, that is no method that is suitable for all projects. It provides
different ways of structuring the SRS. The first two sections of SRS are the same in all of
them. IEEE suggests the following structure for requirements document.
1.Introduction
1.1 Purpose of the requirement’s document
1.2 Scope of the product
1.3 Definitions, acronyms and abbreviations
1.4 References to supporting documents
1.5 Overview of rest of SRS
2.General description
2.1 Product perspective
2.2 Product functions
2.3 User characteristics
2.4 General constraints
2.5 Assumptions and dependencies.
3.Functional requirements
4.Non-functional requirements
5.System architecture
6.System models
7.Appendices
Requirement discovery: This is the process of interacting with stakeholders of the system to
discover their requirements. Domain requirements from stakeholders and documentation are
also discover during this activity.
Step 1: Requirements gathering and analysis : A prototyping model starts with requirement
analysis. In this phase, the requirements of the system are defined in detail. During the
process, the users of the system are interviewed to know what is their expectation from the
system.
Step 2: Quick design. The second phase is a preliminary design or a quick design. In this
stage, a simple However, it is not a complete design. It gives a brief idea of the system to the
user. The quick design helps in developing the prototype .design of the system is created.
Step 3:, Building Prototype an actual prototype is designed based on the information gathered
from quick design. It is a small working model of the required system.
Step 4: Engineer Product. In this stage, the proposed system is presented to the client for an
initial evaluation. It helps to find out the strength and weakness of the working model.
Comment and suggestion are collected from the customer and provided to the developer.
Step 5: Refining prototype.If the user is not happy with the current prototype, you need to
refine the prototype according to the user's feedback and suggestions.
Step 6: Customer evaluation. Once the final system is developed based on the final
prototype, it is thoroughly tested and deployed to production. The system
undergoes routine maintenance for minimizing downtime and prevent large-scale
failures.
The bottom-up design model starts with most specific and basic components. It keeps
creating higher level components until the desired system is not evolved as one single
component.
(b) Logical cohesion : Components that perform similar functions such as input,
error handling and so on are put together in a single document.
Ex : if record-type is student then
display student record
else if record-type is staff then
display staff record
(c) Temporal cohesion : A temporally cohesive module is one whose elements are
functions that are related in time.
Ex :Set counter to 0, Open student file, Clear error message variable, initialize
array.
(f) Functional cohesion :Each part of the component is necessary for the execution
of a single function.
Ex: Compute cosine of angle, Read transaction record, Assign seat to airline
passanger.
9. Explain five types of user system interaction
A user interface, also sometimes called a human-computer interface, comprises both
hardware and software components. It handles the interaction between the user and the
system.There are different ways of interacting with computer systems which have
evolved over the years. There are five main types of user interface:
• command line (cli)
• graphical user interface (GUI)
• menu driven (mdi)
• form based (fbi)
• natural language (nli)
Graphical UI
Graphical user interfaces (GUI) are sometimes also referred to as WIMP because they
use Windows, Icons, Menus and Pointers. Operators use a pointing device (such as a
mouse, touchpad or trackball) to control a pointer on the screen which then interacts
with other on-screen elements.
Menu Driven
A menu driven interface is commonly used on cash machines (also known as automated
teller machines ( ATM's), ticket machines and information kiosks (for example in a
museum). They provide a simple and easy to use interface comprised of a series of
menus and sub-menus which the user accesses by pressing buttons, often on a touch-
screen device.
Form Based
A form-based interface uses text-boxes, drop-down menus, text areas, check boxes,
radio boxes and buttons to create an electronic form which a user completes in order to
enter data into a system. This is commonly used on websites to gather data from a user,
or in call centres to allow operators to quickly enter information gathered over the
phone.
Natural language
A natural language interface is a spoken interface where the user interacts with the
computer by talking to it. Sometimes referred to as a 'conversational interface', This is
the kind of interface used by the popular iPhone application
called Siri and Cortana in Windows
10. What is fault tolerance ? Explain the two approaches to software fault tolerance.
This strategy assumes that residual faults remain in the system. Facilities are provided
in the software to allow operation to continue when these faults cause system failures.
Two approaches to software fault tolerance are:
1) N-version programming: using a common specification, the software system is
implemented in a number of different teams. These versions are executed in
parallel. Their outputs are compared using a voting system and inconsistent
outputs are rejected. At least 3 versions of the system should be available.
2)Recovery Blocks: this is a finger grain approach to fault tolerance. Each program
component is executed successfully. It also includes alternative code, which allows the
system to back-up and repeat the computation if the test detects a failure. Unlike N-
version programing, the implementation is different rather than independent
implementation of the same specification. They are executed in a sequence rather than
independent implementation of the same specification. They are executed in sequence
in sequence rather than in parallel.
Software reliability growth models have been grouped into two classes of models - concavel
and S-shaped. These two model types are shown in Figure 2-2. The most important thing
about both models is that they have the same asymptotic behavior, i.e., the defect detection
rate decreases as the number of defects detected (and repaired) increases
The demerit of this model is that it assumes that all defects contribute equally to the reliability
growth. However in reliability some defects are simple and some are more complex. Hence the
reliability also varies.
2. Random step Function: This model has been designed by little wood and Verall. The model
allows for negative reliability growth to reflect the fact that when a repair is carried out it
may introduce additional errors.
The model explains that as the errors are repaired the average improvement in reliability per
repair decreases. Therefore, contribution of errors to reliability improvement is random
variable.
E = a (KLOC) b
PRODUCT COMPLEXITY A B
• Model 2: Intermediate Cocomomodel :Intermediate cocomo makes use of cost drives and
their multiples to estimate the cost.Model utilizes 15 drives such as product attribute,
hardware attribute, personal attribute, project attribute etc for cost estimation. Ex:
Computers, skilled professional, administrative staff etc.
b
E = (a (KLOC) ) * EAF
• Model 3: Complete Cocomo model :Complex systems are made up of sub-systems, each
parameter of a module must be summed up to get complete cost estimation. There are six
phases in this model they are :
• Planning and requirements
• System design
• Detailed design
• Module code and test
• Integration and test
• Cost Constructive model
(a) Unit Testing : Individual components are tested to ensure that they operate correctly.
Each component is tested independently without referring other system.
(b) Module Testing : A module is a collection of dependent components such as an object
class, an abstract data type or some collection of procedures and functions.
(c) Integration Testing : This phase involves collection of modules which have been
integrated into sub-systems. Sub-systems may be independently designed and
implemented.
(d) System Testing : The sub-systems are integrated to make-up the entire system. It is
also concerned with validating that the system meets its functional and non-functional
requirements.
(e) Acceptance Testing : This is the final stage in the testing process before the system is
accepted for operational use.
Advantages:
• Management problem:
Existing management processes assume a waterfall model of development.
Specialist skills are required which may not be available in all development
teams.
• Maintenance problems:
Continual change tends to corrupt system structure so long-term maintenance
is expensive
Contractual problems.
Advantages:
• The speed with each prototype is put together.
• It also focuses the user on only one aspect of the system so keeping their
feedback precise.
Disadvantages:
• One disadvantage with throw-away prototyping is that developers may be
pressurized by the users to deliver it as a final system.
• Another issue is that in throw-away prototype, all the efforts put in one loft
unlike evolutionary prototype.
18. Describe system procurement process in detail.
• System procurement is a process of acquiring a system for an organization to meet
some identified need.
• The contractor or sub-contractor minimizes the number of organization which the
procurer must deal with. The sub-contractor design and build parts of the system to a
specification produced by the principal contractor. Once completed these different
parts are integrated by the principal contractor. They are then delivered to the
customer by buying the system. The procurement of large hardware or software
system is usually based around some principal contractor.
• Depending on the contract the procurer may allow the principal contractor a free
choice of sub-contractor or may require principal contractor to choice sub-contractor
from an approved list.
3.Operator reliability: How likely is that the operator of a system will make an error?
Consider the real time system made up of five interacting processes shown in the figure:
Some processes accept inputs from their own environment and generate output to that
environment. These inputs may be from sensors, keyboards or some other computer systems.
Similarly, outputs may be to control lines, other computer or user terminals. Inputs from the
environment are labeled with an “I” and output with an “O”. As part of the testing process,
the system should be analyzed to identify as many threads as possible.
21 .Explain the methods for object identification?
22. What are volatile requirements? Explain the classification of volatile requirements.
Volatile requirements are unstable requirements and are likely to change during the system
development process or after the system has been put into (operational) use.
Classification of volatile requirements are:
Types Description
System design is concerned with how the system functionality is to be provided by the
components of the system. The different phases are:
• Partition requirements: analyze the requirement and organize them into related
groups.
• Identify subsystems: identify sub system that can individually or collectively meet the
requirements. group of requirements are usually related to sub systems so this activity
and requirement partitioning may be carried out together.
• Assign requirements to sub system: assign the requirements to each identified sub
systems .in principle this should be straight forward if the requirements partitioning is
used to drive the sub system identification. in practice there is never a clean match
between requirements partitions and identified sub systems. limitations of COTS sub
system may mean that requirements have to be modified
• Specify subsystem functionality: the specific functions provided by each sub system are
specified. This may be seen as a part of the system design phase or if the subsystem is a
software system, part of the system requirement specification activity for that system.
relationship between sub system should also be identified at this stage.
• Define sub system interface: define the interfaces that are provided and expected by
each subsystems. once these interfaces have been agreed parallel development of the
subsystem becomes possible.
24. Explain types of software maintenance.
In a software lifetime, type of maintenance may vary based on its nature. It may be just a
routine maintenance tasks as some bug discovered by some user or it may be a large event in
itself based on maintenance size or nature. Following are some types of maintenance based on
their characteristics:
corrective Enhancement
Proactive Preventive Perfective
Reactive Corrective Adaptive
4.Changing requirements
5.Schedule Optimism
• The legacy challenge: The majority of software systems which are in use today were
developed many years ago yet they perform critical business functions. The legacy
challenge is the challenge of maintaining and updating this software in such a way that
excessive costs are avoided and essential business services continue to be delivered.
• The delivery challenge: Many traditional software engineering techniques are time-
consuming to deliver a quality software. However business operation today change
very frequently, so supporting software must also change rapidly. Software time
should be reduced without compromising on quality of a software product.
Characteristics Description
Graphics Graphical elements can be mixed with text on the same display.
• Advantages of GUI
• They are easy to learn and use. Users without experience can learn to use the
system quickly.
• The user may switch quickly from one task to another and can interact with
several different applications. Information remains visible in its own window
when attention is switched.
• Fast, full-screen interaction is possible anywhere on the screen.
QC concerns not just products ,services and processes ,but also people. if a company has
employees that do not have adequate skills or training and knowledge then quality may be
severely diminished.
Unit - I
DIGITAL LOGIC CIRCUITS: Logic gates Boolean algebra, map simplification,
combinational circuits, flip-flop, sequential circuits. INTEGRATED CIRCUITS AND
DIGITAL FUNCTIONS: Digital integrated circuits, IC flip –flops and registers, decoders
and multiplexers, binary counters, shift registers, random –access memories (RAM) read –
only memories (ROM). [12 Hours]
Unit - II
DATA REPRESENTATION: Data types, fixed-point representation, floating – point
representation, other binary codes, error detection codes. DATA TRANSFER
OPERATIONS: Register Transfer, Memory Transfer and I/O Transfer. [12 Hours]
Unit – III
BASIC COMPUTER ORGANISATION AND DESIGN: Instruction codes, computer
instruction, timing and control, execution and instruction, input-output and interrupt, design
of computer. [12 Hours]
Unit - IV
CENTRAL PROCESSOR ORGANIZATION: Processor bus organization, arithmetic logic
unit (ALU) instruction formats, addressing modes, data transfer and manipulation, program
control, microprocessor organization. [12 Hours]
Unit – V
INPUT-OUTPUT ORGANISATION: Peripheral devices. asynchronous data transfer, direct
memory access (DMA), priority interrupt, input –output processor (IOP). MEMORY
ORGANIZATION: Auxiliary memory, microcomputer memory hierarchy, associative
memory, virtual memory, cache memory. [12 Hours]
Text Books:
1. M. Morris Mano, Computer System, Architecture, 2nd Edition Prentice Hall of India.
Reference Books:
1. Heuring and Jordan, Computer systems design and Architecture, Pearson Edition
2. William Stallings, Computer Organization and Architecture, Pearson Education
3. Floyd, Digital Fundamentals,8th Edition, Pearson Education.
4. Andrew S. Tanenbaum, Structured Computer Organization, 3rd Edition; Prentice Hall of
India.
5. David Patterson & Hennessy, Computer Organization & Design, Elsevier.
BCA503T: COMPUTER ARCHITECTURE
BLUE PRINT
Question paper pattern for theory has foursections :
Section – A :Contains 12 questions, out of which a student has to answer 10 questions. Each
question carries 2 marks ( 10 x 2 = 20 )
Section – B :Contains 8 questions, out of which a student has to answer 5 questions. Each
question carries 5 marks (5 x 5 = 25)
Section – C :Contains 5 full questions includes sub-question as (a) & (b). Student has to
answer 3 full questions. Each full question carries 15 marks(3 x 15 = 45 )
Section – D :Contains 2 questions, out of which a student has to answer 1 question. Each
question carries 10 marks ( 1 x 10 = 10 )
SECTION – A ( 2 Marks)
UNIT-III
[ Nov / Dec 2015 ]
1. What are the two types of control organization?
2. How many bits are needed to specify an address for a memory unit of 4096 words.
SECTION – A ( 2 Marks)
UNIT-IV
[ Nov / Dec 2015 ]
1. What is PSW?
2. What is an external interrupt? Give an example?
SECTION – A ( 2 Marks)
UNIT-V
[ Nov / Dec 2015 ]
1. What are peripherals?
2. What is memory management system?
[ Nov / Dec 2016 ]
3. What is polling?
4. What is memory management system?
SECTION – B ( 5 Marks )
UNIT-I
[ Nov / Dec 2015 ]
1. Simplify the Boolean function F(A,B,C,D)=∑(0,1,2,5,8,9,10) in both SOP and POS .
2. Design 4-to-1 multiplexer.
SECTION – B ( 5 Marks )
UNIT-III
[ Nov / Dec 2015 ]
1. List the micro operations of ADD and ISZ instruction.
2. Explain with neat block diagram the input-output configuration.
SECTION – B ( 5 Marks )
UNIT-V
[ Nov / Dec 2015 ]
1. What is polling? Explain.
2. Explain Associative memory with a neat diagram.
4. Define counter. With a neat diagram explain 4-bit synchronous binary counter.
5. Explain octal to binary encoder with diagram.
Unit – II
1. Explain floating point representation in brief.
2. Explain in brief Gray code.
3. What is Excess 3 code? Explain.
4. What is cyclic code? Explain.
5. Explain code conversion with an example.
Unit – III
1. What is stored program organization? Explain.
2. Explain computer registers.
3. Explain instruction execution.
4. Explain computer instruction with an example.
5. Explain the design of the computer with a flowchart.
Unit – IV
1. Explain Bus organization with a neat diagram.
2. Explain the formats of instructions.
3. What is program interrupt? Explain.
4. Distinguish between RISC and CISC.
5. Explain the arithmetic and logic unit.
Unit – V
1. Give the difference between Isolated I/O vs Memory mapped I/O.
2. Explain strobe control with an example.
3. Explain DMA with a neat diagram.
4. Explain in brief Cache memory and Virtual memory.
5. Explain classification of memory. Explain in brief.
*****
J
11111111111111111111111111111111111 SN - 664
V Semester B.C.A. Degree Examination, NovJDec. 2017
(CBCS) (F + R) (2016-17 and Onwards)
BCA 503 : COMPUTER ARCHITECTURE
SECTION-A
SECTION-B
II. Answer any five questions. Each question carries five marks. (5x5=25)
13) Explain the steps involved in the design of the sequential circuits.
14) Explain synchronous binary counter with logic diagram.
15) Discuss on error detection and correction codes briefly.
16) Explain any five register reference instructions.
17) With a block diagram, explain how BSA instruction executes.
18) Explain the addressing modes.
19) Explain DMA controller with a block diagram.
20) Write a note on virtual memory.
p.T.a.
SN-664 11111111111111111111111111111111111
SECTION-C
21) a) Simplify F(ABCD) = l: m (1,3,7, 11, 15) + l:d (0, 2, 5) using K-map. 7
b) What is a half adder? Design a half adder using only NAND gates. 8
22) a) Explain decoder expansion with neat diagram. 7
b) Discuss the parity generator and parity checker. 8
23) a) Explain common bus organization of basic computer with neat diagram. 8
b) Distinguish between FGI and FGO. 7
24) a) What is a sub-routine? Explain CALL and RETURN instructions. 8
b) Explain the arithmetic logic shift with a neat diagram. 7
25) a) Explain I/O interface unit with a neat diagram. 8
b) Write a note on isolated vs memory mapped I/O. 7
SECTION-D
14. What are the two types of computer architecture based on registers?
1.Von Neumann architecture
2. Harvard architecture
15. Mention the different families of IC.
a. Bipolar families
b. Metal Oxide Semiconductors(MOS) families
20. Write the symbol, logical expression and truth table of NAND gate?
The Logical symbol and truth table
Logical Expression:
Z=(X.Y)’
29. How many bits are needed to specify an address for a memory until of 4096 words?
For a memory unit with 4096 words, weneed 12 bits to specify and address since
212 = 4096.
A NAND gate is a universal gate, meaning that any other gate can be represented as
a combination of NAND gates.
There is ambiguity in the octal to binary encoder that when all the inputs are zero,
an output with all 0’s is generated. Also, when Do is 1, the output generated is zero.
This is a major problem in this type of encoder. This can be resolved by specifying
the condition that none of the inputs are active with an additional output
5. What is half adder? Design a half adder using only NAND gates
Half Adder is the digital circuit which can generate the result of the addition of two
1-bit numbers. It consists of two input terminals through which 1-bit numbers can
be given for processing. After this, the half adder generates the sum of the numbers
and carry if present.
The half adder can also be designed with the help of NAND gates. NAND gate is
considered as a universal gate. A universal gate can be used for designing of any
digital circuitry. It is always simple and efficient to use the minimum number of
gates in the designing process of our circuit. The minimum number of NAND gates
required to design half adder is 5.
The first NAND gate takes the inputs which are the two 1-bit numbers. The
resultant NAND operated inputs will be again given as input to 3- NAND gates
along with the original input. Out of these 3 NAND gates, 2-NAND gates will
generate the output which will be given as input to the NAND gate connected at the
end. The gate connected at the end will generate the sum bit. Out of the 3
considered NAND gates, the third NAND gate will generate the carry bit.
1. With inputs S=0 and R=0, the clock pulse has no effect on output X. The flip
flop is in the idle or hold mode.
2. With inputs S=0 and R=1, when the clock pulse is applied, the active high signal
on R resets or clears the flip flop to 0. Then flip flop is said to be in reset mode.
3. With inputs S=1 and R=0, when the clock pulse is applied, the active high signal
on S sets the flip flop to 1. Then flip flop is said to be in set mode.
4. With inputs S=1 and R=1, when the clock pulse is applied, the flip flop to 0.
The flip flop enters the prohibited or forbidden state. This sate cannot be used.
8. Explain 8 to 3 Encoder
The 8 to 3 Encoder or octal to Binary encoder consists of 8 inputs : Y7 to Y0 and 3
outputs : A2, A1 & A0. Each input line corresponds to each octal digit and three
outputs generate corresponding binary code.
The figure below shows the logic symbol of octal to binary encoder:
A2 = Y7 + Y6 + Y5 + Y4
A1 = Y7 + Y6 + Y3 + Y2
A0 = Y7 + Y5 + Y3 + Y1
The above two Boolean functions A2, A1 and A0 can be implemented using four
input OR gates :
Truth Table :
The logic diagram for Full Adder can be developed from the 2 logical expressions
for S (sum) Cout Carry.
S = AB’Cin + A’BC’in + ABC’in + ABCin
Cout = A’BCin + AB’Cin + ABC’in + ABCin
11. Explain Parity checker and generator.
PARITY CHECKER
• When this device is used as even parity checker, the number of input bits
should always be even. When a parity error occurs, the ∑ even output goes
low and the ∑ odd goes high.
• When it is used as an odd parity checker, the number of input bits should
always be odd. When a parity error occurs, the ∑ odd output gets high.
PARITY GENERATOR
• When this device is used as an even parity generator, the parity bit is taken
at the odd output because this output is a0 if there is an even number of
input bits, and it is a 1 if there is an odd number. When used an odd parity
generator, the parity bit is taken at the a 0 even output because it is a0 when
the number of inputs is odd.
12. Explain error detection and correction code.
• Error detection codes :- are used to detect the error(s) present in the
received data (bit stream). These codes contain some bit(s), which are
included (appended) to the original bit stream. These codes detect the error,
if it is occurred during transmission of the original data (bit
stream).Example − Parity code, Hamming code.
• Error correction codes :- are used to correct the error(s) present in the
received data (bit stream) so that, we will get the original data. Error
correction codes also use the similar strategy of error detection codes.
Example − Hamming code.
Therefore, to detect and correct the errors, additional bit(s) are appended to the data
bits at the time of transmission.
• Parity Code:-It is easy to include (append) one parity bit either to the left of
MSB or to the right of LSB of original bit stream. There are two types of parity
codes, namely even parity code and odd parity code based on the type of parity
being chosen.
• Even Parity Code:-The value of even parity bit should be zero, if even number
of ones present in the binary code. Otherwise, it should be one. So that, even
number of ones present in even parity code. Even parity code contains the data
bits and even parity bit.
The following table shows the even parity codes corresponding to each 3-bit binary
code. Here, the even parity bit is included to the right of LSB of binary code.
Binary Even Parity Even Parity
Code bit Code
000 0 0000
001 1 0011
010 1 0101
011 0 0110
100 1 1001
101 0 1010
110 0 1100
111 1 1111
• Odd Parity Code The value of odd parity bit should be zero, if odd number of ones
present in the binary code. Otherwise, it should be one. So that, odd number of
ones present in odd parity code. Odd parity code contains the data bits and odd
parity bit.
The following table shows the odd parity codes corresponding to each 3-bit binary code.
Here, the odd parity bit is included to the right of LSB of binary code.
13. What is a parity Bit? Explain in brief.
A parity bit is an extra bit included with a binary message to make the total
number of 1s either odd or even.
EVEN Parity ODD Parity
P BCD P BCD
0 0000 1 0000
1 0001 0 0001
1 0010 0 0010
0 0011 1 0011
1 0100 0 0100
0 0101 1 0101
0 0110 1 0110
1 0111 0 0111
1 1000 0 1000
0 1001 1 1001
1. The parity bit can be attached to the code at the beginning or the end,
depending on how the system is designed.
2. At the sending end, the message is applied to a parity generator, where the
required the required parity bit is generated.
3. The message, including the parity bit, is transmitted to its destination.
4. At the receiving end, all the incoming bits are applied to a parity checker that
checks the proper parity adopted (odd or even).
5. If the checked parity does not conform to the adopted parity, an error is
detected.
• The basic computer has eight registers, a memory unit, and a control unit . Paths
must be provided to transfer information from one register to another and between
memory and registers
• The number of wires will be excessive if connections are made between the outputs
of each register and the inputs of the other registers.
• A more efficient scheme for transferring information in a system with many
registers is to use a common bus.
• The connection of the registers and memory of the basic computer to a common bus
system is shown in Fig. below. The outputs of seven registers and memory are
connected to the common bus.
The specific output that is selected for the bus lines at any given time is determined
from the binary value of the selection variables S2, S1, and S0.
• The number along each output shows the decimal equivalent of the required binary
selection. For example, the number along the output of DR is 3.
• The 16-bit outputs of DR are placed on the bus lines when S2S1S0 = 011 since this is
the binary value of decimal 3.
• The lines from the common bus are connected to the inputs of each register and the
data inputs of the memory. The particular register whose LD (load) input is enabled
receives the data from the bus during the next clock pulse transition.
• The memory receives the contents of the bus when its write input is activated. The
memory places its 16-bit output onto the bus when the read input is activated and
S2S1S0 = 111.
• Four registers, DR, AC, IR, and TR, have 16 bits each. Two registers, AR
• and PC, have 12 bits each since they hold a memory address. When the contents of
AR or PC are applied to the 16-bit common bus, the four most significant bits are
set to 0's.
• When AR or PC receive information from the bus, only the 12 least significant bits
are transferred into the register. The input register INPR and the output register
OUTR have 8 bits each and communicate with the eight least significant bits in the
bus.
• INPR is connected to provide information to the bus but OUTR can only receive
information from the bus.
• This is because INPR receives a character from an input device which is then
transferred to AC. OUTR receives a character from AC and delivers it to an output
device. There is no transfer from OUTR to any of the other registers.
• The 16 lines of the common bus receive information from six registers and the
memory unit. The bus lines are connected to the inputs of six registers and the
memory. Five registers have three control inputs: LD (load), INR (increment), and
CLR (clear).
• This type of register is equivalent to a binary counter with parallel load and
synchronous clear. The increment operation is achieved by enabling the count input
of the counter. Two registers have only a LD input.
• The input data and output data of the memory are connected to the common bus,
but the memory address is connected to AR. Therefore, AR must always be used to
specify a memory address.
• By using a single register for the address, we eliminate the need for an address bus
that would have been needed otherwise. The content of any register can be specified
for the memory data input during a write operation. Similarly, any register can
receive the data from memory after a read operation except AC .
• The 16 inputs of AC come from an adder and logic circuit. This circuit has three
sets of inputs. One set of 16-bit inputs come from the outputs of AC . They are used
to implement register micro operations such as complement AC and shift AC .
• Another set of 16-bit inputs come from the data register DR. The inputs from DR
and AC are used for arithmetic and logic rnlcro operations, such as add DR to AC
or AND DR to AC.
• The result of an addition is transferred to AC and the end carry-out of the addition
is transferred to flip-flop E (extended AC bit). A third set of 8-bit inputs come from
the input register INPR.
• Note that the content of any register can be applied onto the bus and an operation
can be performed in the adder and logic circuit during the same clock cycle. The
clock transition at the end of the cycle transfers the content of the bus into the
designated destination register and the output of the adder and logic circuit into
AC.
15. Explain direct and indirect addressing mode with an example.
Direct address mode:
The effective address is equal to the address part of the instruction. The operand resides in
memory and its address is given directly by the address field of the instruction. In a branch
type instruction, the address field specifies the actual branch address.
It consists of a 3bit opcode, a 12 bit address and a mode bit 1 which is 0 for direct address.
A direct address instruction is placed is address 22 in memory.
Indirect Address mode:
The address field of the instruction gives the address where the effective address is stored
in memory. Control fetches the instruction from memory and uses its address part to
access memory again to read the effective address. One bit of the instruction code can be
used to distinguish between a direct and an indirect address.
The instruction is placed in address 35. The mode bit 1 and so is indirect address. The
address part is binary of 300. The control goes to address 300 to find the address of the
operand. The operand found in address 1350 is then added to the content of AC.
Memory Reference – These instructions refer to memory address as an operand. The other
operand is always accumulator. Specifies 12-bit address, 3-bit opcode (other than 111) and
1-bit addressing mode for direct and indirect addressing.
17. What is addressing mode? Explain the different types of addressing modes.
The addressing mode gives or indicates a rule to identify the operands location.
Computers use addressing mode techniques for the purpose of accommodating the
following provisions.
• To give programming versatility to the user.
• To reduce the number of bits in the address field of the instruction.
• To provide flexibility for writing programs.
The various addressing modes available are:
• Implied mode:
In this mode the operands are specified implicitly in the definition of the
instruction. All register reference instructions that use an accumulator ar+
e implied mode instruction.
Ex: CMA
• Immediate mode:
The purpose of an address is to identify an operand value to be used in executing
the instruction. Sometimes the operand values is contained in the instruction
itself, this mode of operand specification is called immediate addressing mode.
Ex: MVI A, 45
• Register mode:
In this mode the operand are in registers which reside within the CPU. The
register is selected from the register field in the instruction.
Ex: MOV AX, BX
• Register indirect mode:
In this instruction, the address field specifies a processor register in the CPU
whose contents give the address of the operand in memory.
Ex: LXI H E000 ; memory address placed in processor register.
18. Explain three types of CPU organization.
There are three types of CPU organizations are:
• Single accumulator organization.
• General register organization.
• Stack organization.
CISC RISC
1. Large number of instructions 1. Fewer instructions
2. Emphasis is on hardware 2.Emphasis is on software
3. It includes multi-clock complex 3.It includes single-clock, reduced
instructions instruction only
4. Memory-to-memory: “LOAD” 4.Register to register: “LOAD” and
and “STORE” incorporated in “STORE” are independent
instructions instructions
5. Code size is small but complex. 5.Code size is large but simple. Low
High cycles per second cycles per second
6. Variable length instruction 6.Fixed length instruction format
format
7. Large variety of addressing 7.Few addressing modes
modes
20. With a block diagram explain how BSA instruction executes .
Branch and Save Return Address
o This instruction is useful for branching to a portion of the program called a
subroutine or procedure.
o When executed, the BSA instruction stores the address of the next
instruction in sequence (which is available in PC) into a memory location
specified by the effective address.
• Unconditional Return instruction: RET is the instruction used to mark the end of
sub-routine. It has no parameter. After execution of this instruction program
control is transferred back to main program from where it had stopped. Value of
PC (Program Counter) is retrieved from the memory stack and value of SP (Stack
Pointer) is incremented by 2.
When executed, the BSA instruction stores the address of the next instruction in
sequence (which is available in PC) into a memory location specified by the
effective address.
The effective address plus one is then transferred to PC to serve as the address of
the first instruction in the subroutine.
This operation was specified with the following register transfer: A numerical
example that demonstrates how this instruction is used with a subroutine
The input register INPR consists of eight bits and holds alphanumeric input
information.
The 1-bit input flag FGI is a control flip-flop.
The flag bit is set to 1 when new information is available in the input device and
is cleared to 0 when the information is accepted by the computer.
The output register OUTR works similarly but the direction of information flow
is reversed.
Initially, the output flag FGO is set to 1.
The computer checks the flag bit; if it is 1, the information from AC is
transferred in parallel to OUTR and FGO is cleared to 0.
The output device accepts the coded information, prints the corresponding
character, and when the operation is completed, it sets FGO to 1.
Input-Output Instructions:
Input and output instructions are needed for transferring information to and
from AC register, for checking the flag bits, and for controlling the interrupt
facility.
Input-output instructions have an operation code 1111 and are recognized by the
control when D7 = 1 and I = 1.
The remaining bits of the instruction specify the particular operation.
Example –
IR register contains = 1111100000000000, i.e. INP after fetch and decode cycle we
find out that it is an input/output instruction for inputing character. Hence, INPUT
character from peripheral device.
30. Explain input and output interface unit with neat diagram?
Input Output Interface provides a method for transferring information between
internal storage and external I/O devices. Peripherals connected to a computer need
special communication links for interfacing them with the central processing unit.
The purpose of communication link is to resolve the differences that exist between
the central computer and each peripheral.
The Major Differences are:-
• Peripherals are electro technical and electromagnetic devices and CPU and
memory are electronic devices. Therefore, a conversion of signal values may be
needed.
• The data transfer rate of peripherals is usually slower than the transfer rate of
CPU and consequently, a synchronization mechanism may be needed.
• Data codes and formats in the peripherals differ from the word format in the
CPU and memory.
• The operating modes of peripherals are different from each other and must be
controlled so as not to disturb the operation of other peripherals connected to
the CPU
• To Resolve these differences, computer systems include special hardware
components between the CPU and Peripherals to supervises and synchronizes
all input and out transfers
These components are called Interface Units because they interface between the
processor bus and the peripheral devices.
I/O BUS and Interface Module: It defines the typical link between the processor
and several peripherals. The I/O Bus consists of data lines, address lines and control
lines. The I/O bus from the processor is attached to all peripherals interface. To
communicate with a particular device, the processor places a device address on
address lines. Each Interface decodes the address and control received from the I/O
bus, interprets them for peripherals and provides signals for the peripheral
controller. It is also synchronizing the data flow and supervises the transfer between
peripheral and processor. Each peripheral has its own controller.
For example, the printer controller controls the paper motion, the print timing. The
control lines are referred as I/O command. The commands are as following:
Control command- A control command is issued to activate the peripheral and to
inform it what to do.
Status command- A status command is used to test various status conditions in the
interface and the peripheral.
Data Output command- A data output command causes the interface to respond by
transferring data from the bus into one of its registers.
Data Input command- The data input command is the opposite of the data output.
In this case the interface receives on item of data from the peripheral and places it
in its buffer register. I/O Versus Memory Bus
Separate instruction control read and write Same instructions can control both I/O and
operation in I/O and Memory Memory
In this I/O address are called ports. Normal memory address are for both
It is complex due to separate separate logic Simpler logic is used as I/O is also treated
is used to control both. as memory only.
(i) Source places data on the data bus and enable Data valid signal.
(ii) Destination accepts data from the data bus and enable Data accepted signal.
(iii) After this, disable Data valid signal means data on data bus is invalid now.
(iv) Disable Data accepted signal and the process ends.
Now there is surety that destination has read the data from the data bus through
data accepted signal. Signals can be seen as:
34. What is polling? Explain.
The software method used to identify the highest priority source is called Polling.
There is one common branch address for all interrupts.
1. The program begins at the branch address and polls the interrupt sources in
sequence.
2. The order in which they are tested decides the priority of the interrupts.
3. First the highest priority source is tested. If its interrupt signal is on, control
branches to a service routine for this source. Otherwise, the next lower priority
source is tested and so on.
4. The initial service routine for all interrupts consists of a program that tests the
interrupt sources in sequence and branches to one of many possible service
routines.
5. The particular service routine reached belongs to the highest priority device
among all devices that interrupted the computer.
2. Capacity:
The capacity of any memory device is expressed in terms of:1) Word size
2)Number of words
• Word size: words are expressed in bytes(8 bits). A word can however mean
my number of bytes.
• Number of words: This specifies the number of words available in the
particular memory device.
3. Unit of transfer:
It is the maximum number of bits that can be read or written into the
memory.
4. Access Methods:
It is fundamental characteristics of memory devices. It is the sequence or order in
which memory can be accessed.
5. Performance
The performance of system is determined using three parameters:
• Access Time : In random access memories, it is the time taken by memory
to complete the read/write operation from the instant that an address is sent
to the memory.
• Memory cycle time: It is defined only for random access memories and is
the sum of the access time and the additional time required before the
second access can commence.
• Transfer rate: It is defined as the rate at which data can be transferred into
or out of a memory unit.
6. Physical rate:
Memory devices can be either semiconductor memory(like RAM) or magnetic
surface memory(Like hard disks).
7. Physical Characteristics:
✓ Volatile/Non Volatile: If a memory devices continues hold data even if power
is turned off. The memory device is non-volatile else it is volatile.
8. Organizations:
✓ Erasable/Non-erasable: The memories in which data once programmed
cannot be erased are called Non-erasable memories. Memory device in which
data in the memory can be erased is called erasable memory.
CPU is the master while the IOP is a slave processor. The CPU performs the task of
initiating all operations.
The operations include
✓ Starting an I/O transfer
✓ Testing I/O status conditions needed for making decisions on various
I/O activities.
I/O instructions are executed in the IOP. The IOP asks for the attention of the CPU
by means of an interrupt. It also responds to CPU requests by placing a status word
in a prescribed location in memory to be examined by CPU program.
For an I/O operation execution, the CPU informs the IOP where to find the I/O
program and then leaves the transfer details to the IOP.
The instructions that are read from memory by an IOP are sometimes called
Commands, to distinguish them from instructions that are read by the CPU.
38. Write a note on cache memory.
The active portions of the program and data are placed in a fast small memory.
This reduces the average memory access time and hence the total execution time of
the program. This memory is called Cache memory. It is placed between the CPU
and the main memory. Performance of cache memory is frequently measured in
terms of a quantity called Hit ratio. Loops and subroutines tend to localize the
references to memory for fetching instruction. Reference to memory at any given
interval of time tend to be confined within a few localized areas in memory. This
phenomenon is known as the property of locality of reference.
The basic operations of cache can be as follows:
1. When CPU wants to access memory, it first examines the cache.
a. If the word is found in the cache, it is read from this memory.
b. If the word is not found in the cache, the main memory is accessed.
2. A block of words containing the most recent accessed one is then transferred
from main memory to cache memory so that future references can find the
required words in cache.
Programmed I/O :
• Programmed I/O instructions are the result of I/O instructions written in
computer program. Each data item transfer is initiated by the instruction in
the program. Usually the program controls data transfer to and from CPU
and peripheral. Transferring data under programmed I/O requires constant
monitoring of the peripherals by the CPU.
During the DMA transfer, the CPU is idle and has no control of the memory buses.
A DMA Controller takes over the buses to manage the transfer directly between the
I/O device and memory.
The CPU may be placed in an idle state in a variety of ways. One common method
extensively used in microprocessor is to disable the buses through special control
signals
such as:
◼ Bus Request (BR)
◼ Bus Grant (BG)
These two control signals in the CPU that facilitates the DMA transfer. The Bus
Request
(BR) input is used by the DMA controller to request the CPU. When this input is
active, theCPU terminates the execution of the current instruction and places the
address bus, data bus and read write lines into a high Impedance state. High
Impedance state means that the output is disconnected
The CPU activates the Bus Grant (BG) output to inform the external DMA that the
Bus Request (BR) can now take control of the buses to conduct memory transfer
without processor. When the DMA terminates the transfer, it disables the Bus
Request (BR) line. The CPU disables the Bus Grant (BG), takes control of the buses
and return to its normal operation.
The transfer can be made in several ways that are:
i. DMA Burst
ii. Cycle Stealing
i) DMA Burst :- In DMA Burst transfer, a block sequence consisting of a number of
memory words is transferred in continuous burst while the DMA controller is
master
of the memory buses.
ii) Cycle Stealing :- Cycle stealing allows the DMA controller to transfer one data
word at a time, after which it must returns control of the buses to the CPU.
Virtual memory was developed at a time when physical memory -- the installed
RAM -- was expensive. Computers have a finite amount of RAM, so memory can
run out, especially when multiple programs run at the same time. A system using
virtual memory uses a section of the hard drive to emulate RAM. With virtual
memory, a system can load larger programs or multiple programs running at the
same time, allowing each one to operate as if it has infinite memory and without
having to purchase more RAM.
While copying virtual memory into physical memory, the OS divides memory into
pagefiles or swap files with a fixed number of addresses. Each page is stored on a
disk and when the page is needed, the OS copies it from the disk to main memory
and translates the virtual addresses into real addresses.
*****
SOLUTION BANK
BLUE PRINT
Question paper pattern for theory has two sections :
Section – A :Contains 12 questions, out of which a student has to answer 10 questions.
Each question carries 2 marks ( 10 x 2 = 20 )
Section – B :Contains 5 full questions includes sub-question as (a) & (b). Each full
question carries 10 marks (5 x 10 = 50)
SECTION A SECTION B
UNIT CHAPTER
2 MARKS 10 MARKS
Introduction to JAVA 1 -
Inheritance - 1
II
Arrays, Strings and Vectors 1 1
Wrapper Class - -
Interfaces 1 1
III Packages 1 1
Multithreaded Programming: 1 2
Managing Exceptions 1 1
IV
Applet Programming 1 2
Graphics Programming 1 2
V
Managing Input/Output Files in JAVA 1 1
TOTAL 12 16
TOTAL MARKS 20 50
SECTION – A ( 2 Marks)
UNIT-I
[Nov / Dec 2015]
1. What do you mean by command line argument?
2. What are the two ways of giving values to the variable?
3. Write down the default values of byte and char data types?
SECTION – A ( 2 Marks)
UNIT-II
[Nov / Dec 2015]
1. Define a class and write down its syntax?
2. What is the use of ‘this’ and ‘super’ keyword?
3. How multiple inheritances are achieved in Java?
SECTION – A ( 2 Marks)
UNIT-IV
[Nov / Dec 2015]
1. What is exception?
2. How user defined exception is done?
3. Write down the applet code for “hello-class”file?
4. Why repaint () method is used?
SECTION – A ( 2 Marks)
UNIT-V
[ Nov / Dec 2015 ]
1. Which method is used to draw a circle?
1. What is the difference between character oriented and byte oriented streams?
2. What is stream? How stream are classified?
3. What is the use of Graphic class?
SECTION – B ( 5 Marks )
UNIT-I
[Nov / Dec 2015]
1. Explain the features of java?
2. Write a note on scope of variables?
3. Explain the features of java?
4. Write a program to display all prime numbers between two limits using command line
argument.
SECTION – B( 5Marks)
UNIT-II
[Nov / Dec 2015]
1. Differentiate between string and string buffer.
2. What is vector? Mention its advantages over an array.
3. How string class different from string buffer class? Give two methods of string class.
4. What is method overriding? Write a program to demonstrate method overriding.
5. Explain any seven string methods with example.
6. Write a note on inheritance.
[Nov / Dec 2016]
1. How to create object? What happens when you create objects?
2. Demonstrate ‘this’ keyword with simple java program.
3. Differentiate component and container class.
4. Give the general form of inheritance with one example.
5. Illustrate array declaration and accessing data elements using an example.
6. Differentiate constructors and methods.
7. Write a program to sort a list of elements in ascending order.
SECTION – B( 5 Marks)
UNIT-III
[Nov / Dec 2015]
1. What is package? Write down the steps for creating user defined package.
2. What is thread ?explain thread cycle with neat diagram.
3. What is interface? Write a program to demonstrate interface.
SECTION – B( 5 Marks)
UNIT-IV
SECTION – B( 5 Marks)
UNIT-V
2. Write down the default values of byte and char data types?
➢ The default value of byte=0
➢ The default value of char=NULL CHARACTER
8. What is exception?
Ans. An exception is an error that occurs at run time.
Ans.
import java.applet.Applet;
import java.awt.Graphics;
public class HelloCLASSApplet extends Applet
{
public void paint(Graphics g){
g.drawString("Hello CLASS", 50, 50);
}
}
Ans. Java is one of the simple programming language because java removes some
complex concept like pointer and execution time will be less.
Reasons:-
➢ Much easier to write bug free code.
➢ Java has considerably more functionality than c.
Ans.
switch(expression)
{
Case value1:
break;
Case value2:
break;
……….
default:
}
19. What is instance variable? Give an example.
Ans.
➢ Instance variables are declared in a class , but outside a method. They are also
called member or field variables.
➢ Instance variables are created when an object is created and destroyed when the
object is destroyed.
Ans. Errors are related to errors that occur in the java virtual machine itself, and not in
a program. These types of exceptions are beyond our control, and a program will not
handle them.An exception is an error which can be handled .An error is an error which
cannot be handled.
26. What is the purpose of ‘init ()’ method in applet?
30. What are the default values of float and char primitive data types in java?
Ans.
• Default value of float =0.0f
• Default value of char = NULL CHARACTER
Ans. Labeled break: the break statement breaks out the closest loop or switch
statement.
Ex: for(int i=0;i<10;i++){
while(true){
break;
}
}
Labelled continue: the continue statement transfers the control to the closest enclosing
loop.
Ex: for(int i=0;i<10;i++){
while(j<10){
if(j==5)
continue;
}
}
32. Define package. Mention its use.
Ans. Package in Java is a mechanism to encapsulate a group of classes, sub packages and
interfaces. Packages are used for preventing naming conflicts.
A constructor name should be always The method and class name can be same
same as class name or different
36. Difference between class and abstract class?
Class Abstract class
The class does not contain abstract It contains abstract methods
methods
The class can be instantiated Abstract classes cannot be instantiated
Ans.
➢ CurrentThread()
➢ getName()
➢ run()
➢ sleep()
Ans.
➢ Private
➢ Default
➢ Protected
➢ Public
42. Define a stream in java. Briefly mention the broad classification of java stream classes?
Ans. A stream can be defined as a sequence of data. The input stream is used to read data
from a source and the Output Stream is used for writing data to a destination.
43. How applets differ from applications?
Ans. The main difference between Applet and Application is that the applet is a small
java program that can be executed by a Java-compatible web browser while
the application is a standalone program that can directly run on the machine.
It is slow and consumes more memory It is fast and consumes less memory
5 MARKS QUESTIONS
1. Explain the features of java?
Declaration:
class staticdemo{
int x,y;
static int z;
}
3. Explain any three string methods with example?
• concat(): This method creates a new string by appending the contents of string
object passed as arguments to the contents of string on which the method is
invoked.
Example:
publicString concat(String str)
String str=”Skyward”;
System.out.println(str.concat(“Publishers”)); //”Skyward Publishers” is printed.
• replace(): This method creates a new string using the same contents as that of the
string object on which the method is invoked.
Example:
public String replace(char old,char new)
String original=”Java ProgrAmming”;
System.out.println(original.replace(‘a’,’o’)); //”Javo Programming” is printed.
• substring(): The substring method creates a new string using partial contents of
the string on which it is invoked. This method has two overloaded version.
Example:
public String substring(int begin)
public String substring(int begin,int end)
String original=”watermelon”;
System.out.println(original.substring(5)); // prints “rings”
4. Differentiate between arrays and vectors?
Ans:
Public: The public modifiers is the least restrictive of all access modifiers. It can apply it
to a class, its methods and its member variables. A public class can be instantiated
without any restrictions.
EXAMPLE:
package pack;
public class A{
public void msg(){System.out.println(“Hello”);}
}
//save by B.java
package mypack;
import pack.*;
class B{
public static void main(String args[]){
A obj = new A();
Obj.msg();
}
}
6. What is Interface? Explain with an example how a class implements an interface.
Ans: An interface is a description of a set of abstract methods that is supported to be
implemented by the classes. In an interface no method can include a body. It specifies
what can be done, but no implementation. Once an interface is defined any number of
classes can be implemented. The interface can be defined using the interface keyword.
Syntax:
interface interface_name {
public static varibles
public abstract methods
}
Example:
interface XYZ
{
public void functionx();
public void functiony();
}
class ABC implements XYZ
{
public void functionx() { }
public void functiony() { }
}
7.Explain user defined exception in Java?
Ans: Java provides us facility to create our own exceptions which are basically derived
classes of exception. Things to remember before writing an exception
• All exceptions must be a child of Throwable
• To write a runtime exception, extend the RuntimeException class.
Running: When the thread enters in this state, the JVM starts to execute the thread
run() method. The thread remains in this state and keep running until it is either
swapped out by thread scheduler or it voluntarily give up its turn for some reasons.
Not-ready-to-run (Blocked state): A thread moves out of the running state when it is
waiting for something to happen.
Sleeping: We may want a thread to do-nothing for some time. We can call
Thread.sleep() method in the thread run() method. This method tells the currently
running thread to sleep for some period of time.
Waiting: Sometimes a thread might wait(), just because we have asked it to wait in its
run method. In that case,the thread changes its state from running to waiting .
Blocked: Sometimes a thread needs to wait for a resource while running. For instance ,if
it is reading from a network resources in its run method, it has to wait until that
resource becomes available.
Dead state: A java thread enters this state when it has finished the execution of its run
method. We cannot start the thread once it is dead. The thread can be started only once
in its life time. If we re-invoke start() on a thread which is dead,it does not start again.
Using isAlive() method we can test whether the thread is alive or dead.
not-ready-to-run
[waiting/blocked/sleep
ing]
10.Explain how parameters are passed to an applet?
Ans: Applet can get different input from the HTML file that contains the
<APPLET>tag through the use of applet parameter. To set up and handle parameters
in the applet , we need two things:
1. A special parameter tag in the HTML file.
2. Code in our applet to read those parameters.
Example:
import java.applet.Applet;
import java.awt.Font;
import java.awt.Graphics;
public class MyFontApplet extends Applet {
String fontName;
int fontSize;
public void init() {
fontName = getParameter(“font”);
fontSize = Integer.parseInt(getParameter(“size”));
}
Public void paint (Graphics g) {
Font f = new Font(fontName and fontSize);
g.setFont(f);
g.drawString(“Skyward Publishers”,50,50);
}
}
11.Explain any seven methods of graphics class with an example for each?
Ans:
METHODS DESCRIPTION
draw3Drect() Draws a 3-D rectangle
drawArc() Draws an arc
drawLine() Draws a line
drawOval() Draws an oval
fillArc() Draws a filled arc
fillOval() Draws a filled oval
fillRect Draws a filled rectangle
• Example for drawLine( )
import java.awt.Graphics;
public class DrawLineDemo extends java.applet.Applet {
public void paint(Graphics g) {
g.drawLine(25,25,75,75);
}
• Example for draw3Drect( )
import java.awt.Graphics;
public class DrawLineDemo extends java.applet.Applet {
public void paint(Graphics g) {
g.draw3DRect(20,20,60,60,true);
g.draw3DRect(120,20,60,60,false);
}
• Example for drawArc( ) and fillArc( )
import java.awt.Graphics;
public class DrawLineDemo extends java.applet.Applet {
public void paint(Graphics g) {
g.drawArc (50,50,80,60,45,120);
g.fillArc(150,50,80,60,45,120);
}
Example:
File f = new File(“myFile.dat”);
FileOutputStream fos;
try {
fos = new FileOutputStream(f);
}catch(IOException) {
}
13. Explain with example:
Method overloading: Method Overloading means to have two or more methods with
same name in the same class with different arguments.
Example:
class Myclass {
public void getAmount (int rate) {….}
public void getAmount (int rate, long principal) {….}
}
Method overriding: Method overriding occurs when sub class declares a method that
has the same type arguments as a method declared by one of its super class.
Example:
class Baseclass {
public void getAmount (int rate) {….}
}
class Myclass extends Baseclass{
public void getAmount (int rate) {….}
}
Abstract method: A method without body is known as abstract method. A method must
always be declared in an abstract class.
Example:
abstract void method1(); // Abstract method
Abstract class: Abstract classes are classes that contain one or more abstract methods.
Example:
abstract class Test { // Abstract class
int a,b,c;
abstract void method1(); // Abstract method
abstract void method2(); // Abstract method
void method3() {
}
}
14. Write a short notes on data output stream and data input stream?
Input stream
• Input stream is an abstract class that provides the framework from which all
the other input streams are derived
• We cannot create an instance of inputstream class as it is abstract class .
• Whenever we want to read the data in bytes format, then we use the input
stream classes
• The inputsream class contains lot of methods for reading bytes , closing stream
,skipping part of data in the streams. finding the number of bytes present in the
input data ,etc.
Output stream
• Output stream is an abstract class that provides the framework from which all
other output streams are derived
• We cannot create an instance of outputstream class as it is abstract class
• Whenever we want to write data in byte format, then we use the output stream
classes.
• The outputstream class contains lot of methods for writing bytes, closing streams
,etc.
•
public class AppletMouseListener extends Applet implements MouseListener
{
String str="";
JDK JRE
JDK needs more disk space as it JRE is smaller than JDK so it needs less disk
contains JRE along with various
Development tools space
Operands
Operand
Right Operand .
Overloading
1. Signature has to be different just a difference in return type is not enough.
2. Any access modifier can be used.
3. The methods exception list may vary freely
4. The method to be called will be decided at the time of compilation.
5. Methods can be static or non-static.
Over Ridding
1. Signature can be same.
2. Over ridding method cannot be more restrictive than the over ridden method.
3. Over ridding method may not throw more checked exceptions than the
overridden method.
4. The method to be called will be decided at the time of run time based on type of
the object.
5. Static method don’t participate in over ridding since they are resolved at compile
time based on the type of reference variable.
23) How to create objects? What happens when you create objects?
An object is created by instantiating a class. The process of creating an object of a class
is called as instantiation and created object is called as an instance.
• To create a new object, java uses the new keyword
• The object are created using the new operator with the name of the class we
want to create an instance of, then parentheses after that. The general form of
creating an object is
<classname><reference-
variable>=new<classname>([arguments])
• When an object is created an instance of a class is created. Reference variable
does not define an object but it is simply a variable that can refer to an
object. The new operator dynamically allocates memory for an object and
returns a reference to it.
• Eg: Account acc = new Account();
Where Account is a class name, acc is reference variable and new is the
operator to create an object. The Account object is created in the heap
memory. The address of that object is assigned to the reference variable acc.
The reference variable is declared in the stack.
class Test
{
int a;
int b;
Test(int a, int b)
{
this.a = a;
this.b = b;
}
void display()
{
System.out.println("a = " + a + "b = " + b +);
}
Logical operators return a true or false value based on the state of the variables.
&& (Short circuit If both the operands are non zero then ( A&&B ) is false
AND operator) the condition becomes true.
| (OR operator) If any of the two operands are non zero ( A|B ) is true
then the condition becomes true
|| (Short circuit OR If any of the two operands are non zero ( A||B ) is true
operator) then the condition becomes true.
^ (XOR operator) This return true only if its operand. If ( A^B ) is true
its operand are different otherwise
false.
! (NOT operator) Use to reverses the logical state of its !( A&&B ) is true
operand. If a condition is true then
logical NOT operator make false.
27. Illustrate array declaration and accessing data elements using an example.
Array is collection of elements of same type. The array stores a fixed-size sequential
collection of elements of the same type.
Declaring an array
The array declaration is usually the data type followed by a pair of square brackets
followed by the name of the array
Method
• A method is used for any general purpose tasks like calculations.
• The method name and class name can be same or different.
• A method can be called after creating the object.
• A method can be called any number of times on the object
• A method is executed only when we want it.
29) Explain try and catch with an example.
Ans. The core of exception handling is try and catch . these keywords works together.
we cannot have a try without a try.
General form of the try/catch exception handling blocks
try
{
// do risky things
}
catch(Exception ex)
{
//try to recover
}
Try
A try block is simply the keyword try. followed by braces enclosing the risky code that
can throw the exception.
try
{
}
Catch
A catch block consists of the keyword catch followed by a single parameter between
parentheses that identify the type of exception that the block is to deal with. this is
followed by the code to handle the exception enclosed between braces
try{
}
catch(Exception ex){
}
try
{
K=i/j;
}
catch (ArithmeticException e)
{
System.out.println(“exception occurred: divition by zero”);
K=i/(j+2);
}
System.out.println(“the value of k is :” + k);
}
}
bubbleSort(a,5);
System.out.println(“\n\n after sorting \n”);
System.out.println(“ Ascending order \n”);
for( int i=0;i<5;i++)
System.out.print(“ “ +a[i]);
}
}
• Here, pkg is the name of the package. for example, the following statement
creates a package called project1.
package pack1;
• Java uses the file system to manage packages, with each package stored in its
own directory. for example, the class files for any classes we declare to be part of
pack1 must be stored in directory called pack1.
• Step1: create a program which is part of package called pack1
package pack1;
Package pack2;
Import pack1.*;;
• In this file, we are trying to import the pack1 classes and creating an object of
packageExample
Unit - III 2 3 34
Programming techniques
Total 12 11 104
SECTION – A ( 2 Marks)
UNIT-I
[ Nov / Dec 2016 ]
01. Draw the flag register mentioning the flag status?
[ Nov / Dec 2017]
01. What is Microprocessor? Give the word length of 8085 Microprocessor.
02.Explain Program Counter and Stack Pointer.
03. Explain SID and SOD pins of 8085.
[ Nov / Dec 2018]
01. What is a microprocessor?
02. Explain briefly about the different types of buses in 8085.
03. Name the flags of 8085.
04. Define the terms machine cycle and instruction cycle.
05. What is memory interfacing?
[ TMAQ - important tutor mark assignment questions ]
01.Define T- state, Machine Cycle and Instruction Cycle.
02. What is address bus and data bus.
03. What is the use of ALE.
UNIT-II
[ Nov / Dec 2016]
01. What is the function of instruction register and decoder?
02. What is Immediate addressing? Mention an example.
03. Write any two instructions to clear the contents of accumulator register.
04. Find the contents of accumulator after executing the following block of program segment.
Content of B register is 3EH. Initially.
MOV A,B
RLC
RLC
HLT
05. Explain DAA instruction
06. Two consecutive memory locations store 3EH and 2FH data respectively. Find the content of
accumulator after executing following segment of program.
LXI H 2050H
MOV A,M
INX H
SUB M
INX H
MOV M, A
[ Nov / Dec 2017]
01. Write any two examples for 3 byte Instructions.
02. Explain Instruction DAD D.
03. Find the number of bytes required to store the following instructions:
I. CPI FFH.
II. LXI D, 8500.
[ Nov / Dec 2018]
01. Mention any two instructions which clear the contents of accumulator.
02.. Explain any two data transfer instructions of 8085.
03. Compare SUB reg and CMP reg instructions.
04. Write an assembly language program to find the 2’s complement of an 8-bit number.
UNIT-II
[ Nov / Dec 2016]
01. Draw the flowchart to generate delay loop using register.
[ Nov / Dec 2017]
01.What is Subroutine?
02. Define counting and looping.
03.Compare POP and PUSH Instruction.
[ Nov / Dec 2018]
01. Define counters and time delays.
02. Write an ALP to add two-N byte numbers.
UNIT-IV
[ Nov / Dec 2016]
01. Differentiate between absolute and partial decoding.
[ Nov / Dec 2017]
02. Define maskable and Non-maskable interrupts of 8085.
[ Nov / Dec 2018]
03. Define interrupt.
UNIT-V
SECTION – B ( 5 Marks)
UNIT-I
UNIT-II
[Nov / Dec 2016]
01.a) Write an ALP to add two-N byte numbers.
b) Classify the instructions based on sizes and explain each with example.
02. a) Explain i) STAX D ii) ADC R iii)XCHG instructions.
03. Write an ALP for block transfer of data bytes.
[ Nov / Dec 2017]
01. Write a program to load 07F in the register B and find its 2’s compliment.
02. Explain the following instructions of 8085:
STAXD
CMPM
XCHG
3. Write short notes on :
a) Addressing modes of 8085.
b) Data transfer instructions in 8085.
UNIT III
UNIT-IV
UNIT-V
[ Nov / Dec 2016]
01. Explain the functional block diagram of 8255 PPI.
02. write a note on interfacing devices.
SECTION – A ( 2 Marks)
UNIT-I
[ Nov / Dec 2016 ]
01. Draw the flag register mentioning the flag status?
[ Nov / Dec 2017]
01. What is Microprocessor? Give the word length of 8085 Microprocessor.
A microprocessor is a multipurpose programmable clock driven register based
semiconductor device manufactured by using VLSI techniques to perform all
computations in digital computer.
UNIT-II
03. Write any two instructions to clear the contents of accumulator register.
1.MVI A 00H
2.XRA A
3.SUB A
4.ANI 00H....
04. Find the contents of accumulator after executing the following block of
program segment. Content of B register is 3EH. Initially.
MOV A,B
RLC
RLC
HLT
3 E
0011 1110 1st RLC (to shift left by 1 bit)
F 8
1111 1000 Accumulator=F8
06. Two consecutive memory locations store 3EH and 2FH data respectively.
Find the content of accumulator after executing following segment of
program.
LXI H 2050H
MOV A,M
INXH
SUBM
INXH
MOV M, A
(1111) Borrow
3E-> 00111110
2F-> 00101111
00001111
rp = BC, DE, or HL
As rp can have any of the three values, there are three opcodes for this type of instruction. It
occupies only 1-Byte in memory.
03. Find the number of bytes required to store the following instructions:
I. CPI FFH.
II. LXI D, 8500.
I. 16bits (2 bytes).
II. 8bits (3 byte).
UNIT-III
01.What is Subroutine?
A subroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This
unit can then be used in programs wherever that particular task have to be performed. A subroutine is
often coded so that it can be started (called) several times and from several places during one execution of
the program, including from other subroutines, and then branch back (return) to the next instruction after
the call, once the subroutine’s task is done. It is implemented by using Call and Return instructions.
UNIT-IV
UNIT-V
Control signals:
The control signals are provided to support the 8085 memory instructions. They control
functions such as when the bus is to carry a valid address in which direction data are to be
transferred over the bus, when to put read data on the system bus.
Three control signals are RD, WR & ALE.
RD – This signal indicates that the selected IO or memory device is to be read and is
ready for accepting data available on the data bus.
WR – This signal indicates that the data on the data bus is to be written into a selected
memory or IO location.
ALE – It is a positive going pulse generated when a new operation is started by the
microprocessor. When the pulse goes high, it indicates address. When the pulse goes
down it indicates data.
It requires 3 T-States.
During T1, A8-A15 contains higher byte of address. At the same time ALE is high.
Therefore Lower byte of address A0-A7 is selected from AD0-AD7.
During T2 ALE goes low, RD(bar) goes low. Address is removed from AD0-AD7
and data D0-D7 appears on AD0-AD7.
1. Accumulator
2. Temporary register
3. Arithmetic and Logic Unit (ALU)
4. Flag register
5. Instruction Register
6. Instruction Decoder and Machine cycle encoder
7. General purpose registers
8. Stack Pointer
9. Program Counter
10. Increment / Decrement
11. Timing and Control unit
12. Interrupt control
13. Serial I/O control
14. Address buffer and Address / Data buffer
1. Accumulator (A-register)
It is an 8-bit register. It is associated with ALU. The accumulator is also called A-register.
During the arithmetic / logic operations, one of the operand is available in Accumulator. The
result of the arithmetic / logic operations is also stored in the Accumulator.
4. Flag register
It is an 8-bit register. But only five bits are used. The flag positions in the flag register are shown
below.
Flag register of 8085: The flags are affected by the arithmetic and logic operations in the ALU.
The flag register is also known as Status register or Condition code register. There are five flags
namely Sign (S) flag, Zero (Z) flag, Auxiliary Carry (AC) flag, Parity (P) flag and Carry (CY)
flag.
• Sign (S) flag: Sign flag is set (1) if the bit D7 of the result in the accumulator is 1, otherwise it
is reset (0). This flag is set when the result is negative. This flag is used only for signed numbers.
• Zero (Z) flag: Zero flag is set (1) if the result in the accumulator is zero, otherwise it is reset
(0).
• Auxiliary Carry (AC): Auxiliary Carry flag is set (1) if there is a carry from bit position D3of
result in the accumulator, otherwise it is reset (0). This flag is used for BCD operations.
• Parity (P) flag: Parity flag is set (1) if the result in the accumulator has even number of 1s,
otherwise it is reset (0).
• Carry (CY) flag: Carry flag is set (1) if the result of an arithmetic operation results in a carry
from bit position D7, otherwise it is reset (0). This flag is also used to indicate a borrow
condition during subtraction operations.
5. Instruction register
When an instruction is fetched from memory, it is stored in the Instruction register. It is an 8-bit
register. This resister cannot be used in the programs.
02. What are flags? Draw the format of flag register and explain their
function.
The Flag register is a Special Purpose Register. Depending upon the value of result after any
arithmetic and logical operation the flag bits become set (1) or reset (0). In 8085
microprocessor, flag register consists of 8 bits and only 5 of them are useful.
It is an 8-bit register having five 1-bit flip-flops, which holds either 0 or 1 depending upon the
result stored in the accumulator.
These are the set of 5 flip-flops −
Sign Flag: It occupies the seventh bit of the flag register, which is also known as the most
significant bit. It helps the programmer to know whether the number stored in the
accumulator is positive or negative. If the sign flag is set, it means that number stored in
the accumulator is negative, and if reset, then the number is positive.
Zero Flag:It occupies the sixth bit of the flag register. It is set, when the operation
performed in the ALU results in zero (all 8 bits are zero), otherwise it is reset. It helps in
determining if two numbers are equal or not.
Auxiliary Carry Flag: It occupies the fourth bit of the flag register. In an arithmetic
operation, when a carry flag is generated by the third bit and passed on to the fourth bit,
then Auxiliary Carry flag is set. If not flag is reset. This flag is used internally for BCD
(Binary-Coded Decimal Number) operations.
Parity Flag: It occupies the second bit of the flag register. This flag tests for number of
1’s in the accumulator. If the accumulator holds even number of 1’s, then this flag is set
and it is said to even parity. On the other hand, if the number of 1’s is odd, then it is reset
and it is said to be odd parity.
Carry Flag: It occupies the zeroth bit of the flag register. If the arithmetic operation
results in a carry (if result is more than 8 bit), then Carry Flag is set; otherwise it is reset.
UNIT-II
[ Nov / Dec 2016]
01. Write an ALP to add two-N byte numbers.
MEMORY
MNEMONICS COMMENTS
ADDRESS
03.Three-byte instructions –
Three-byte instruction is the type of instruction in which the first 8 bits indicates the opcode and
the next two bytes specify the 16-bit address. The low-order address is represented in second
byte and the high-order address is represented in the third byte.
Example-1:
Task- Load contents of memory 2050H in the accumulator.
Mnemonic- LDA 2050H
Opcode- LDA
Operand- 2050H
Hex Code- 3A
50
20
Binary code- 0011 1010
0101 0000
0010 0000
iii) XCHG: - Exchange H and L with D and E. The contents of register H are exchanged with the
contents of register D, and the contents of register L are exchanged with the contents of register
E.
Eg: - XCHG
Eg:- STAX B (the content of accumulator is stored into the memory location specified by the
BC register pair.)
Compare (register or memory) with accumulator (CMP R/M):
This is a 1-byte instruction. It compares the data byte in the register or memory with the contents
of accumulator.
1. If A less than (R/M), the CY flag is set and Zero flag is reset.
2. If A equals to (R/M), the Zero flag is set and CY flag is reset.
3. If A greater than (R/M), the CY and Zero flag are reset.
When memory is an operand, its address is specified by HL Pair. No contents are modified;
however all remaining flags (S, P, AC) are affected according to the result of subtraction.
XCHG:-Exchange H and L with D and E. The contents of register H are exchanged with the
contents of register D, and the contents of register L are exchanged with the contents of
register E.
LXI Rp, 16-bit data [Load register pair immediate]: Specified 16-bit data is loaded
into the register pair[Rp]. Where, Rpis BC, DE or HL register pair or SP (Stack Pointer).
Ex: The instruction required to load 16-bit data 2050H into the DE register pair is LXID
D, 2050H
It is 3-byte size.
Immediate addressing mode.
10 T-state.
3 machine cycle.
No flags are affected.
LDA 16-bit address: It transfers the content stored in the addressed memory location to
accumulator.
Ex: Assume 2050 memory location contains the 8-bit data is 25H into the accumulator.
Instruction: LDA 2050H.
3-byte size.
Direct addressing mode.
13 T-state.
4 machine cycle.
No flags are affected.
STA 16-bit address (Store Accumulator direct): It transfers the content stored in the
accumulator to addressed memory location.
Ex: Assume Accumulator contains 25H as 8-bit data. The instruction required to transfer
the contents of accumulator(25H) into the memory location of 2050H.
Instruction: STA 2050H.
3-byte size.
Direct addressing mode.
13 T-state.
4 machine cycle.
No flags are affected.
LDAX Rp (Load accumulator indirect): The contents of memory location whose
address is in BC or DE register pair is loaded into the accumulator. Here Rp can be BC or
DE register pair.
[A] [[Rp]]
Ex: Assume the contents of B and C are 20H and 50H respectively and memory location
2050H has the 8-bit data is 30H. The instruction required to load this content into the
accumulator.
Instruction: LDAX B
1-byte size.
Register addressing mode.
7 T-state.
2 machine cycle.
No flags are affected.
STAX Rp (Store accumulator indirect): The content of accumulator is stored in
memory location whose address is in either BC or DE register pair. Here also Rpcan be
BC or DE register pair.
[[Rp]][A]
Ex: Assume accumulator content is 70H and registers D and E respectively. The
instruction required to store the content of accumulator into 2050H memory location.
Instruction: STAX D
1-byte size.
Register direct addressing mode.
7 T-state.
2 machine cycle.
No flags are affected.
LHLD 16-bit address [Load H and L direct]: The instruction copies the contents of the
memory location pointed out by the 16-bit address in register L and copies the contents of
the next memory location in register H.
[L][16-bit address]
[H][16-bit address + 1]
Ex: Assume the contents of memory location 2050H and 2051 are 42H and 32H. The
instruction required to store the data 42H are 32H into H and L register.
Instruction: LHLD 2050H
3-byte size.
Direct addressing mode.
16 T-state.
5 machine cycle.
No flags are affected.
SHLD 16-bit address (Store H and L direct): This instruction copies the contents of L
and H registers into two consecutive memory locations. The contents of L register are
stored in the memory location specified by the 16-bit address in the operand and the
contents of H register are stored in the next memory locations by incrementing the
operand.
[16-bit address] [L]
[16-bit address + 1] [H]
Ex: Assume the contents of H and L are 50H and 62H respectively. To store this data in two
consecutive memory location 2050H and 2051H.
Instruction: SHLD 2050H.
3-byte size.
Direct addressing mode.
16 T-state.
5 machine cycle.
No flags are affected.
XCHG (Exchange H and L with D and E): The contents of H and L registers are
exchanged with the contents of D and E registers.
Ex: Assume H and L registers contents are 10H and 15H and the contents of D and E
registers are 20H and 25H respectively. The instruction required to exchange the HL and
DE register pair content.
Instruction: XCHG.
3-byte size.
Direct addressing mode.
4 T-state.
1 machine cycle.
No flags are affected.
Mnemonic- MOV B, A
Opcode- MOV
Operand- B, A
Hex Code- 47H
Binary code- 0100 0111
2. Two-byte instructions –
Two-byte instruction is the type of instruction in which the first 8 bits indicates the opcode and
the next 8 bits indicates the operand.
Example-1:
Task- Load the hexadecimal data 32H in the accumulator.
Mnemonic- MVI A, 32H
Opcode- MVI
Operand- A, 32H
Hex Code- 3E
32
Binary code- 0011 1110
0011 0010
3. Three-byte instructions –
Three-byte instruction is the type of instruction in which the first 8 bits indicates the opcode and
the next two bytes specify the 16-bit address. The low-order address is represented in second
byte and the high-order address is represented in the third byte.
Example-1:
Task- Load contents of memory 2050H in the accumulator.
Mnemonic- LDA 2050H
Opcode- LDA
Operand- 2050H
Hex Code- 3A
50
20
Binary code- 0011 1010
0101 0000
02. a) write assembly language program to subtract two 16- bit numbers.
Memory Label Mnemonics operand Machine comments
code
Address
F000 START LXI H F102 21 02 F1 Point to 2nd number
F003 LXI D F100 11 00 F1 Point to 1st number
F006 LXI B FFF7 01 F7 FF Point to result
F009 LDAX D IA Get lower byte of 1st
number into
accumulator
F00A SUB M 96 Subtract lower byte
of 2nd number
F00B STAX B 02 Store lower byte
result in FFF7
FOOC INX H 23 Point to higher byte
of 2nd number
F00D INX D 13 Point to higher of 1st
byte number
F00El INX B 03 Point to higher byte
of result
F00F LDAX D IA Get higher byte of
1st number
F010 SUB M 9E Subtract higher byte
of 2nd number
F011 STAX B 02 Store higher byte
result in FFF8
F012 CALL UPDAD CDBC 06 -
F015 JMP DISP C3 12 F0 -
DAD Rp – Add register pair to HL register pair: The 16 bit contents of the specified register pair
are added to the contents of the HL register pair and the sum is saved in the HL register pair. The
content of the source register pair is not altered.
03. With an example, explain the logical instructions of 8085 microprocessors.
AND Operations
ANA R [AND register ‘R’ with accumulator]: In this instruction each bit of the given
register contents are ANDed with each bit f the accumulator contents [bit by bit]. The result
is saved in the accumulator. It does not affect the contents of the given register
[A][A]AND[R]
Where, R can bean accumulator or any general purpose register [A,B,C,D,E,H or L].
Ex: Assume ‘A’ contain 54H and register B contains 82H and CY=1
Instruction: ANA B
1-byte size
Register addressing mode.
4 T-state.
1 machine cycle.
Z, S and P flags are affected.
OR Operations
ORA R[OR register with accumulator]: In this instruction each bit of the given register
contents are ORed with each bit of the accumulator contents[bit by bit]. The result is saved in the
accumulator. It does not affect the contents of the given register.
[A][A] OR [R]
Where, R can be an accumulator or any general purpose register[A,B,C,D,E,H or L].
Ex: Assume[A]=73H and [C]=C3H before execution of the instruction ORA C. After execution
of the instruction ORA C is:
Instruction ORA C
1-byte size
Register addressing mode
4 T-state
1 Machine cycle
Z, S and P flags are affected
EX-OR operation
XRA R:[Exclusive OR register with Accumulator]: In this instruction each bit of the
given register contents are XORed with each bit of the accumulator contents. The result is saved
in the accumulator. It does not affect the contents of the given register.
[A][A]XOR[R]
Where, R can be an accumulator or any general purpose register[A,B,C,D,E,H or L].
Ex: Assume [A]= 77H and register[D]=56H
Instruction: XRA D; [21H][77H]XOR[56H]
1-byte size
Register addressing mode
4 T-state
1 Machine cycle
Z, S and P flags are affected
Compare instructions
The microprocessor compares the contents of the accumulator with the data byte memory
contents by subtracting the data byte or register contentsfrom the accumulator.
CMP R:The contents of register R is subtracted from the contents of Accumulator but the result
is not stored. Result not stored [A]- [R].
Ex: Assume [A] =25H and Register [C] =09H. The instruction required to compare the contents
of register C from the Accumulator.
Instruction: CMP C
1-byte size
Register addressing mode
4 T-state
1 Machine cycle
All flags are affected.
CPI 8-bit data [Compare immediate 8-bit data with Accumulator]: The given 8-bit is
subtracted from the contents of accumulator but the result in not stored.
RLC (Rotate Accumulator Left): Each binary bit of the accumulator is rotated left by one bit
position. The high order bit (D7) is shifted to low-order bit(D0) as well as to the carry
flag(CY). Cy is modified according to bit D7.
Ex: Assume [A]=C6H and CY=0, before executing the RLC instructions.
1-byte size
Implicit addressing mode
4 T-state
1 Machine cycle +
CY flag is affected.
CMC (Complement the carry status): This instruction complements the carry flag.
CYCY
Ex: If CY=1 before the execution of CMC instruction, the carry flag will be reset (CY=0)
after the execution of this instruction. Similarly, if CY=0 before the execution of CMC
instruction, the carry flag will be set(CY=10 after the execution of this instruction.
1-byte size
Implicit addressing mode
4 T-state
1 Machine cycle
CY flag is affected
STC (Set carry flag): The carry flag is set to 1.
CY1
1-byte size
Implicit addressing mode
4 T-state
1 Machine cycle
CY flag is affected
UNIT III
[ Nov / Dec 2016]
01. Explain unconditional Jump Instructions.
The unconditional Jump instructions enable the programmer to set up continuous loops.
INSTRUCTION
Opcode Operand Description
JMP 16-bit Jump
34 56
The PUSH B instruction makes the following changes in memory as shown and top of stack
is decremented by 2.
i.e. Top Of Stack = SP – 2 = 2000 – 2 = 1998
Memory location Data
2000 34
1999 56
1998 POP operation:
POP is used to
extract data off stack and to store in register pair
Syntax
POP Reg. pair
The contents of the memory location pointed out by the stack pointer register are copied to
the low-order register (C, E, L, status flags) of the operand. The stack pointer is incremented
by 1 and the contents of that memory location are copied to the high-order register (B, D, H,
A) of the operand. The stack pointer register is again incremented by 1.
Conditional Call Instructions: - The conditional call instructions transfer the program
execution flow to the address of the subroutine program when certain condition is satisfied.
CC 16-bit address [CALL Subroutine if Carry Flag is set]: The addressed subroutine will
be called by the microprocessor, if the Carry Flag is Set (CY=1) as per the result of the
preceding instruction.
[SP-1][PCH]
[SP-2][PCL]
and [PC]16-bit address, to transfer the program sequence to specified memory location of the
subroutine program.
Return Instructions:The return instructions are used to end of the subroutine to transfers the
program sequence from subroutine program to the calling program unconditionally or
conditionally.
It is of two types:
Unconditional return instruction:
1. RET (Return from Subroutine unconditionally): The RET instruction is used at the
end of the subroutine to transfers the program sequence from subroutine program to
the instructions of the main program next to the CALL instruction which called the
subroutine.
[PCL][SP]
[PCH][SP + 1]
[SP] [SP] + 2
1-byte size.
Register Indirect addressing mode.
10 T-state.
4 machine cycle.
No flags are affected.
Conditional return instruction: If the condition is true the execution of the conditional
return instruction takes 3 machine cycles and 12 T-states. If the condition is not true only
one Machine cycles and 6 T-states are required to execute the instructions.
[PCL][SP]
[PCH][SP + 1]
1-byte size.
Register Indirect addressing mode.
12 T-state.
3 machine cycle.
No flags are affected.
UNIT-IV
[ Nov / Dec 2016]
01. Compare memory mapped I/O and I/O mapped I/O.
Vector interrupt – In this type of interrupt, the interrupt address is known to the
processor. For example: RST7.5, RST6.5, RST5.5, TRAP.
Non-Vector interrupt – In this type of interrupt, the interrupt address is not known to the
processor so, the interrupt address needs to be sent externally by the device to perform
interrupts. For example: INTR.
Maskable interrupt – In this type of interrupt, we can disable the interrupt by writing
some instructions into the program. For example: RST7.5, RST6.5, RST5.5.
Software interrupt – In this type of interrupt, the programmer has to add the instructions
into the program to execute the interrupt. There are 8 software interrupts in 8085, i.e.
RST0, RST1, RST2, RST3, RST4, RST5, RST6, and RST7.
Hardware interrupt – There are 5 interrupt pins in 8085 used as hardware interrupts, i.e.
TRAP, RST7.5, RST6.5, RST5.5, INTA.
Read Interrupt Mask instruction provides status information about interrupt system and this
instruction can be used for serial input of data. Through this RIM instruction, 8085 can know
which interrupt is masked or unmasked, etc. The contents of the Accumulator after the execution
It consists of three 8-bit bidirectional I/O ports i.e. PORT A, PORT B and PORT C. We
can assign different ports as input or output functions.
The 8255A is a general purpose programmable I/O device designed to transfer the data
from I/O to interrupt I/O under certain conditions as required. It can be used with almost
any microprocessor.
It consists of three 8-bit bidirectional I/O ports (24I/O lines) which can be configured as
per the requirement.
Ports of 8255A
8255A has three ports, i.e., PORT A, PORT B, and PORT C.
Port A contains one 8-bit output latch/buffer and one 8-bit input buffer.
Port B is similar to PORT A.
Port C can be split into two parts, i.e. PORT C lower (PC0-PC3) and PORT C upper
(PC7-PC4) by the control word.
These three ports are further divided into two groups, i.e. Group A includes PORT A and upper
PORT C. Group B includes PORT B and lower PORT C. These two groups can be programmed
in three different modes, i.e. the first mode is named as mode 0, the second mode is named as
Mode 1 and the third mode is named as Mode 2.
Operating Modes
8255A has three different operating modes –
Mode 0 – In this mode, Port A and B is used as two 8-bit ports and Port C as two 4-bit
ports. Each port can be programmed in either input mode or output mode where outputs
are latched and inputs are not latched. Ports do not have interrupt capability.
Mode 1 – In this mode, Port A and B is used as 8-bit I/O ports. They can be configured as
either input or output ports. Each port uses three lines from port C as handshake signals.
Inputs and outputs are latched.
Mode 2 – In this mode, Port A can be configured as the bidirectional port and Port B
either in Mode 0 or Mode 1. Port A uses five signals from Port C as handshake signals
for data transfer. The remaining three signals from Port C can be used either as simple
I/O or as handshake for port B.
Features of 8255A
The prominent features of 8255A are as follows –
It consists of 3 8-bit IO ports i.e. PA, PB, and PC.
Address/data bus must be externally demux’d.
It is TTL compatible.
It has improved DC driving capability.
HOLD signal: This is an active high input signal to the 8085 and active high output signal
to the DMA controller. This signal is operated by DMS controller to transfers the data
between two peripherals through DMA controller or without being routed through
microprocessor. This signal goes high when the DMA controller requesting to use the
address and data buses for data transfer between I/O devices to memory and vice-versa
without involvement of microprocessor.
HLDA (Hold Acknowledge): This is an active high output signal to the microprocessor.
This signal goes high when the microprocessor surrenders the address and the data buses
to transfer data between the peripherals through DMA controller.
SOLUTION BANK
EVALUATION FORM
EVALUATION FORM
% of
Sl. No. Subject Date % pending Remark
Completion
SOLUTION BANK
FEEDBACK FORM
FEEDBACK FORM
2 PRESENTATION STYLE
3 CONTENT COVERAGE
6 YOUR REMARKS
STUDENT REG. NO
STUDENT NAME
STUDENT SIGNATURE
BACHELOUR OF COMPUTER APPLICATIONS (B.C.A)
V SEMESTER