DLCOA Complete Notes Openinapp
DLCOA Complete Notes Openinapp
🎗️ 🎗️
KEEP SHARE THIS LINKS
👇👇👇👇👇👇👇👇👇👇👇👇
JOIN US TELEGRAM ALL LINKS FOR NOTES
⭐ 👉
1.CLICK TO JOIN CHANNEL @engineeringnotes_mu
⭐ 👉
2.CLICK TO JOIN GROUP @engineering_notes_mu
a. (21)10-(8)10
b. (73)10-(49)10
i) 147 in to binary
v) 23 in to gray code
Vi) Represent -786.25 using IEEE 754 standards (both single and double precision format
a. AND
b. OR
c. NOT
d. NAND
e. NOR
f. EX-OR
a. (16)10 X (3) 10
b. (17)10 X (-5)10
D.What is the difference between Computer organization and Computer architecture explain it
with examples
6. Explain & perform restoring division when divisor V=3 and dividend D=7.7. Explain & perform
the division using non storing division :
Dividend = 1011
Divisor = 0101
a. SR flip-flop
b. JK flip-flop
c. D flip-flop
d. T flip-flop
a. Cache coherency
b. Cache Memory
c. Amdahl’s La
22.Draw and explain 4 stage instruction pipelining and briefly describe the hazards associated
with it
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
🎯 🎯
Join Telegram:- @engineeringnotes_mu
HERE YOU GET ALL (MUMBAI UNIVERSITY ) ENGINEERING NOTES
🎗️ 🎗️
KEEP SHARE THIS LINKS
👇👇👇👇👇👇👇👇👇👇👇👇
JOIN US TELEGRAM ALL LINKS FOR NOTES
⭐ 👉
1.CLICK TO JOIN CHANNEL @engineeringnotes_mu
⭐ 👉
2.CLICK TO JOIN GROUP @engineering_notes_mu
Course Outcome:
1. To learn different number systems and basic structure of
computer system.
2. To understand the basic concepts of digital components and to
demonstrate the arithmetic algorithms and control signals.
3. To demonstrate the memory organization and different Buses .
4. To describe the principles of parallel processing .
1. Computer Fundamentals (5Hrs)
Join Telegram:- @engineeringnotes_mu
Chapter 1
Digital Logic Gates
1.1 Introduction
Electronic devices are of mainly two type as analog devices and digital devices and it work on
analog and digital signal respectively. The signal which changes continuously is known as
analog signal, like when vehicle starts it’s speed increases gradually means it starts with speed
0 km\hr and then reaches to required maximum say 120km\hrs and it is continuously changing.
Electric power is also continuously fluctuating 50 times in a second in India. Examples of
analog signal are electrical power supply, human speech, Thermometer etc. Because of
changing nature of this signal, processing and storage become difficult.
On starting electrical device’s using switch it performs operation as a ON or OFF, having only
two values as HIGH and LOW which is discrete in nature. This type of signals is known as
digital signal. The devices which work on digital signals are known as digital devices.
Examples of digital devices are Computer, Digital devices, Digital pen etc.
1
Join Telegram:- @engineeringnotes_mu
Truth Table is table which gives all possible input and corresponding o utput for it. Table 1.1
is truth table for two input AND gate with corresponding output, here inputs are X and Y and
output is Q.
Q = X AND Y
=X∩Y
= X.Y
For AND gate input may be more than two but output will be one
1.2.2 OR Gate
Logical OR operation is similar to the arithmetic addition operation where all input as zero will
give the output as zero.
Figure 1.3 shows symbol for an OR gate where X and Y are the input which will be either 1 or
0 and Q is output which gives output (1) when at least one input is 1.
2
Join Telegram:- @engineeringnotes_mu
X Y Q
X 0 0 0
Q
Y 1 0 1
0 1 1
1 1 1
X Q
X 0 1
Q
1 0
3
Join Telegram:- @engineeringnotes_mu
X Y Q
X
Q 0 0 1
Y 1 0 1
0 1 1
1 1 0
Table 1.4 is truth table for two input NAND gate with corresponding output, here inputs are X
and Y will be either 0 or 1 and output is Q will be 1 when at least one inputs are 0. Complement
of truth table of AND gate is the truth table of NAND gate.
-----------
Q = X AND Y
------
= X.Y
While implementation of logical expression basic logical gates used are AND, OR and NOT,
but for the same we can use NAND and NOR gate with which we implement any logical
expression that’s why it is known as universal gate. Majority of design use this concept.
Figure 1.6 shows how NAND gates can be used to implement NOT, AND, and OR gates.
X Q=X
X XY
Q = XY
Y
4
Join Telegram:- @engineeringnotes_mu
X
X
Q = X+Y
Y
Y
(c) OR Gate
Figure 1.6: NOT, AND, and OR gate using only NAND gates.
X Y Q
X Q 0 0 1
Y
1 0 0
0 1 0
1 1 0
Table 1.5 is truth table for two input NOR gate with corresponding output, here inputs are X
and Y will be either 0 or 1 and output Q is 1 when both inputs are 0. Complement of truth table
of OR gate is the truth table of NOR gate.
--------
Q= X+Y
--------
= XVY
NOR gate is also universal gate so it is also used to implement AND, OR, and NOT gate.
5
Join Telegram:- @engineeringnotes_mu
X Q Q
Y
Y
NOR gate using OR and NOT gate.
X Y Q
X Q 0 0 0
Y 1 0 1
0 1 1
1 1 0
Boolean algebra is the rules use on Boolean variable for performing manipulation on Boolean
expression which is necessity in digital systems. We know that digital logic work on digital
signals which is either logic 1 (HIGH) or logic 0 (LOW).
The number system having base 2 and digit in it as 0 and 1 is known as Binary Number System
which is used digital systems like computer, calculator, camera, mobile, etc.
We consider logical variable as X and Y having value as 0 or 1 at particular time.
6
Join Telegram:- @engineeringnotes_mu
7
Join Telegram:- @engineeringnotes_mu
Computer: Computer is a fast electronic device, which accepts DIGITISED information as input; process
it according to the PROGRAM stored in its memory, and gives the resultant output.
Computer Architecture is concerned with the way Computer Organization is concerned with the
hardware components are connected together to structure and behavior of a computer system as
form a computer system. seen by the user.
It acts as the interface between hardware and It deals with the components of a connection in
software. a system.
Computer Architecture helps us to understand the Computer Organization tells us how exactly all
functionalities of a system. the units in the system are arranged and
interconnected.
A programmer can view architecture in terms of Whereas Organization expresses the realization
instructions, addressing modes and registers. of architecture.
Computer Architecture deals with high-level design Computer Organization deals with low-level
issues. design issues.
Input Unit
Data and instructions are entered into the computer through the input unit to get processed
into information. Input devices like the keyboard, the mouse, or the microphone are used to
enter the data. The data is entered in various forms depending on the type of input devices.
For instance, a keyboard can be used to input characters, numbers, and certain symbols; a
mouse is a device that has an on-screen pointer that enables the users to select items and
choose options; a microphone can be used if the user wishes to enter instructions by
Making a voice entry. Regardless of the ways in which the input devices receive the inputs,
the input interfaces convert them into binary codes, i.e., 0s and 1s, as the primary memory
of the computer is designed to accept data only in this format. Several advancements can
be seen in input devices with devices like cordless keyboards, optical mouse, laser mouse,
cordless mouse, etc., being introduced in the market.
The actual processing of the data is carried out in the Central Processing Unit (CPU), which
is the brain of computer. The CPU stores the data and instructions in the primary memory of
the computer, called the Random Access Memory (RAM) and processes them from this
location. The Arithmetic Logic Unit (ALU) and the Control Unit (CU) are the two
subcomponents of the CPU. The ALU carries out the arithmetic and logical operations while
the CU retrieves the information from the storage unit and interprets this information. The
CPU also consists of circuitry devices called cache and registers.
Join Telegram:- @engineeringnotes_mu
The data and instructions stored in the RAM are transferred to the ALU for processing. The
ALU performs the logical and the arithmetic operations on the data and the results are
temporarily stored in the RAM. After the processing, the final results are stored in the
secondary memory, i.e., the storage unit, and are released through an output device.
Control unit
The CU obtains the program instructions stored in the primary memory of the computer,
interprets them, and issues signals that result in their execution. It helps in maintaining
order and directs the operations of the entire system. It selects, interprets, and ensures the
proper execution of the program instructions.
Processors
Some computers use more than one processor for processing in order to reduce the load
on a single processor.
Output Unit
The output unit passes on the final results of computation to the users through the output
devices like the monitor, printer, etc. A monitor displays the final results of the processed
data on the screen while a printer can be used for obtaining the output in a printed format.
These output devices link the computer with the users. The output interfaces convert the
binary code produced by the computer into the human-readable form.
Storage Unit
Before the actual processing takes place, the data and instructions that enter the computer
system have to be stored internally. Also, the final results generated by the computer after
processing has to be stored before being sent to the output unit. The storage unit of a
computer system is designed to store the data generated at various stages of processing.
Storage media like hard disks, floppy disks, etc., aid in storing the data in various forms.
The hard disk is an integral part of the computer system. It is also referred to as hard drive,
disk drive, or hard disk drive. The hard disk provides a large amount of storage space for
the programs and data. Computers these days feature a hard disk that has several
Join Telegram:- @engineeringnotes_mu
gigabytes of storage capacity. The floppy disk drives, CD-ROM/CD-RW drives, DVD drives,
and USB ports enable the user to store and exchange data with others using storage media
like floppy disks, compact discs (CDs), digital video discs (DVDs), and pen drives.
Buses
The group of wires over which signal is transfer is known as Bus. There are basic three types of buses.
Address bus, data bus, and control bus.
Address Bus: - The bus over which address is transfer is known as address bus and it is unidirectional.
Data Bus: - The bus over which data is transfer is known as data bus and it is bidirectional.
Control Bus: - The bus over which control signals are transfer is known as control bus and it is
bidirectional.
Join Telegram:- @engineeringnotes_mu
Von-Neumann Architecture
In a Von-Neumann architecture (also known as Stored Program Computer), the same
memory and bus are used to store both data and instructions that run the program.
Since you cannot access program memory and data memory simultaneously, the Von
Neumann architecture is susceptible to bottlenecks and system performance is affected.
Harvard Architecture
The Harvard architecture stores machine instructions and data in separate memory
units that are connected by different busses. In this case, there are at least two memory
address spaces to work with, so there is a memory register for machine instructions and
another memory register for data. Computers designed with the Harvard architecture
are able to run a program and access data independently, and therefore
simultaneously. Harvard architecture has a strict separation between data and code.
Thus, Harvard architecture is more complicated but separate pipelines remove the
bottleneck that Von Neumann creates.
`
Join Telegram:- @engineeringnotes_mu
1. Half Adder :
Half Adder is a combinational logic circuit which is designed by connecting one EX-OR gate
and one AND gate. The half adder circuit has two inputs: A and B, which add two input digits
and generates a carry and a sum.
The output obtained from the EX-OR gate is the sum of the two numbers while that obtained
by AND gate is the carry. There will be no forwarding of carry addition because there is no
logic gate to process that. Thus, this is called Half Adder circuit.
Logical Expression:
Sum = A XOR B
Carry = A AND B
Truth Table:
Join Telegram:- @engineeringnotes_mu
2. Full Adder :
Full Adder is the circuit which consists of two EX-OR gates, two AND gates and one OR gate.
Full Adder is the adder which adds three inputs and produces two outputs which consists of
two EX-OR gates, two AND gates and one OR gate. The first two inputs are A and B and the
third input is an input carry as C-IN. The output carry is designated as C-OUT and the normal
output is designated as S which is SUM.
Equation obtained by EX-OR gate is the sum of the binary digits. While the output obtained by
AND gate is the carry obtained by addition.
Truth Table :
Logical Expression :
SUM = (A XOR B) XOR Cin = (A ⊕ B) ⊕ Cin
CARRY-OUT = A AND B OR Cin(A XOR B) = A.B + Cin(A ⊕ B)
Join Telegram:- @engineeringnotes_mu
Difference between Half adder and full adder:
In Half adder there are two input bits In full adder there are three input bits
3 ( A, B). (A, B, C-in).
Logical Expression for half adder is : Logical Expression for Full adder is :
4 S=a⊕b ; C=a*b. S=a⊕b⊕Cin; Cout=(a*b)+(Cin*(a⊕b)).
It consists of one EX-OR gate and It consists of two EX-OR, two AND gate and
5 one AND gate. one OR gate.
Multiplexer
Multiplexer means many into one. A multiplexer is a circuit used to select and route any
one of the several input signals to a single output. A simple example of an non-electronic
circuit of a multiplexer is a single pole multi-position switch.
Multi-position switches are widely used in many electronics circuits. However, circuits that
operate at high speed require the multiplexer to be automatically selected. A mechanical
Join Telegram:- @engineeringnotes_mu
switch cannot perform this task efficiently. Therefore, multiplexer is used to perform high
speed switching are constructed of electronic components.
Multiplexers can handle two type of data i.e., analog and digital. For analog application,
multiplexer are built using relays and transistor switches. For digital application, they are
built from standard logic gates.
The multiplexer used for digital applications, also called digital multiplexer, is a circuit with
many input but only one output. By applying control signals (also known as Select
Signals), we can steer any input to the output. Some of the common types of multiplexer
are 2-to-1, 4-to-1, 8-to-1, 16-to-1 multiplexer.
Following figure shows the general idea of a multiplexer with n input signal, m control
signals and one output signal.
The 4-to-1 multiplexer has 4 input bits, 2 control or select bits, and 1 output bit. The four
input bits are D0,D1,D2 and D3. Only one of this is transmitted to the output Y. The
output depends on the values of A and B, which are the control inputs. The control input
determines which of the input data bit is transmitted to the output.
Join Telegram:- @engineeringnotes_mu
For instance, as shown in figure, when A B = 0 0 , the upper AND gate is enabled, while
all other AND gates are disabled. Therefore, data bit D0 is transmitted to the output,
giving Y = Do.
If the control input is changed to A B = 1 1 , all gates are disabled except the bottom
AND gate. In this case, D3 is transmitted to the output and Y = D3.
Demultiplexer
Demultiplexer means one to many. A demultiplexer is a circuit with one input and many
outputs. By applying control signal, we can steer any input to the output. Few types of
demultiplexer are 1-to 2, 1-to-4, 1-to-8 and 1-to 16 demultiplexer.
Following figure illustrate the general idea of a demultiplexer with 1 input signal, m control
signals, and n output signals.
Join Telegram:- @engineeringnotes_mu
When A B = 0 1 , the second AND gate from the top is enabled while other AND gates are
disabled. Therefore, data bit D is transmitted to the output Y1, giving Y1 = Data.
If D is LOW, Y1 is LOW. If D is HIGH, Y1 is HIGH. The value of Y1 depends upon the value
of D. All other outputs are in low state.
If the control input is changed to A B = 1 0, all the gates are disabled except the third
AND gate from the top. Then, D is transmitted only to the Y2 output, and Y2 = Data.
Example of 1-to-16 demultiplexer is IC 74154. It has 1 input bit, 4 control / select bits and
16 output bits.
Applications of Demultiplexer
1. Demultiplexer is used to connect a single source to multiple destinations. The main
application area of demultiplexer is communication system, where multiplexers are
used. Most of the communication system are bidirectional i.e., they function in both
ways (transmitting and receiving signals). Hence, for most of the applications, the
multiplexer and demultiplexer work in sync. Demultiplexer are also used for
reconstruction of parallel data and ALU circuits.
2. Communication System – Communication system use multiplexer to carry
multiple data like audio, video and other form of data using a single line for
transmission. This process make the transmission easier. The demultiplexer receive
the output signals of the multiplexer and converts them back to the original form of
the data at the receiving end. The multiplexer and demultiplexer work together to
carry out the process of transmission and reception of data in communication
system.
3. ALU (Arithmetic Logic Unit) – In an ALU circuit, the output of ALU can be stored
in multiple registers or storage units with the help of demultiplexer. The output of
Join Telegram:- @engineeringnotes_mu
ALU is fed as the data input to the demultiplexer. Each output of demultiplexer is
connected to multiple register which can be stored in the registers.
4. Serial to Parallel Converter – A serial to parallel converter is used for
reconstructing parallel data from incoming serial data stream. In this technique,
serial data from the incoming serial data stream is given as data input to the
demultiplexer at the regular intervals. A counter is attach to the control input of the
demultiplexer. This counter directs the data signal to the output of the demultiplexer
where these data signals are stored. When all data signals have been stored, the
output of the demultiplexer can be retrieved and read out in parallel.
This is just an introduction to the concept of Demultiplexer. To learn more about
Demultiplexers, read this What is Demultiplexer (DEMUX) tutorial.
1. Multiplexer :
Multiplexer is a data selector which takes several inputs and gives a single output. In
multiplexer we have 2n input lines and 1 output lines where n is the number of selection
lines.
2. Demultiplexer :
Demultiplexer is a data distributor which takes a single input and gives several outputs. In
demultiplexer we have 1 input and 2 n output lines where n is the selection line.
Join Telegram:- @engineeringnotes_mu
Multiplexer Demultiplexer
Truth Table –
Input Output
D7 D6 D5 D4 D3 D2 D1 D0 X Y Z
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 0 0 0 1
0 0 0 0 0 1 0 0 0 1 0
0 0 0 0 1 0 0 0 0 1 1
0 0 0 1 0 0 0 0 1 0 0
0 0 1 0 0 0 0 0 1 0 1
0 1 0 0 0 0 0 0 1 1 0
1 0 0 0 0 0 0 0 1 1 1
As seen from the truth table, the output is 000 when D0 is active; 001 when D1 is active;
010 when D2 is active and so on.
Implementation –
Join Telegram:- @engineeringnotes_mu
From the truth table, the output line Z is active when the input octal digit is 1, 3, 5 or 7.
Similarly, Y is 1 when input octal digit is 2, 3, 6 or 7 and X is 1 for input octal digits 4, 5, 6 or
7. Hence, the Boolean functions would be:
X = D4 + D5 + D6 + D7
Y = D2 +D3 + D6 + D7
Z = D1 + D3 + D5 + D7
Hence, the encoder can be realised with OR gates as follows:
One limitation of this encoder is that only one input can be active at any given time. If more
than one input is active, then the output is undefined. For example, if D6 and D3 are both
active, then, our output would be 111 which is the output for D7. To overcome this, we use
Priority Encoder
Join Telegram:- @engineeringnotes_mu
2. Decoders –
A decoder does the opposite job of an encoder. It is a combinational circuit that converts n
lines of input into 2 n lines of output.
Let’s take an example of 3-to-8 line decoder.
Truth Table –
Input Output
X Y Z D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
Implementation –
D0 is high when X = 0, Y = 0 and Z = 0. Hence,
D0 = X’ Y’ Z’
Similarly,
D1 = X’ Y’ Z
D2 = X’ Y Z’
D3 = X’ Y Z
D4 = X Y’ Z’
D5 = X Y’ Z
D6 = X Y Z’
D7 = X Y Z
Join Telegram:- @engineeringnotes_mu
Hence,
Flip Flops
A flip flop is an electronic circuit with two stable states that can be used to store binary data.
The stored data can be changed by applying varying inputs. Flip-flops and latches are
fundamental building blocks of digital electronics systems used in computers,
communications, and many other types of systems. Both are used as data storage elements.
It is the basic storage element in sequential logic. But first, let’s clarify the difference between
a latch and a flip-flop.
SR Latch
A flip-flop, on the other hand, is synchronous and is also known as a gated or clocked SR
latch.
SR Flip-Flop
In this circuit diagram, the output is changed (i.e. the stored data is changed) only when you
give an active clock signal. Otherwise, even if the S or R is active the data will not change.
Let’s look at the types of flip-flops to understand better.
SR Flip Flop
There are majorly 4 types of flip-flops, with the most common one being SR flip-flop. This
simple flip-flop circuit has a set input (S) and a reset input (R). In this system, when you Set
Join Telegram:- @engineeringnotes_mu
“S” as active the output “Ǫ” would be high and “ Ǭ ” will be low. Once the outputs are
established, the wiring of the circuit is maintained until “S” or “R” go high, or power is turned
off. As shown above, it is the simplest and easiest to understand. The two outputs, as shown
above, are the inverse of each other. The truth table of SR Flip-Flop is highlighted below.
Input Output
CLK S R Qn+1
1 0 0 Qn
1 0 1 0
1 1 0 1
1 1 1 ?
JK Flip-flop
Due to the undefined state in the SR flip-flop, another flip-flop is required in electronics. The
JK flip-flop is an improvement on the SR flip-flop where S=R=1 is not a problem.
The input condition of J=K=1, gives an output inverting the output state. However, the outputs
are the same when one tests the circuit practically.
In simple words, If J and K data input are different (i.e. high and low) then the output Q takes
the value of J at the next clock edge. If J and K are both low then no change occurs. If J and
Join Telegram:- @engineeringnotes_mu
K are both high at the clock edge then the output will toggle from one state to the other. JK
Flip-Flops can function as Set or Reset Flip-flops.
Input Output
CLK J K Qn+1
1 0 0 Qn
1 0 1 0
1 1 0 1
1 1 1 Ǭn
D Flip Flop
D flip-flop is a better alternative that is very popular with digital electronics. They are
commonly used for counters and shift-registers and input synchronization.
In this, the output can be only changed at the clock edge, and if the input changes at other
times, the output will be unaffected.
Input Output
CLK D Qn+1
1 0 0
1 1 1
The change of state of the output is dependent on the rising edge of the clock. The output (Q)
is same as the input and can only change at the rising edge of the clock.
Join Telegram:- @engineeringnotes_mu
T Flip Flop
A T flip-flop is like a JK flip-flop. These are basically a single input version of JK flip-flops. This
modified form of JK flip-flop is obtained by connecting both inputs J and K together. It has
only one input along with the clock input.
These flip-flops are called T flip-flops because of their ability to complement its state (i.e.)
Toggle, hence the name Toggle flip-flop.
Input Output
CLK T Qn+1
1 0 Ǫn
1 1 Ǭn
Applications of Flip-Flops
These are the various types of flip-flops being used in digital electronic circuits and the
applications of Flip-flops are as specified below.
Counters
Frequency Dividers
Shift Registers
Storage Registers
Join Telegram:- @engineeringnotes_mu
Chapter 2
2 14 7 3 1
0 1 1 1
↑
For conversion result collect restored bits from step no I onwards followed by decimal point.
(0.01)2
Above procedure is shown in figure 2.
2 27 13 6 3 1
1 1 0 1 1← MSB
Join Telegram:- @engineeringnotes_mu
(27)10 = (11011)2
Fractional Part conversion
(27.125)10 = (11011.001)2
Example6: Convert following number into binary number.
1) (39.325)10 2) (55.42)10 3) (170.12)10 4) (1220.065)10
Solution:
1) (39.325)10
Integer part conversion
2 39 19 9 4 2 1
1 1 1 0 0 1 ← MSB
(39)10 = (100111)2
Fractional Part conversion
While multiplying after getting first restoring bit as 1 continue multiplying till two consecutive
same restoring bits (00 or 11) then stop multiplying. If more precise result is expected then
continue multiplying till three or four same consecutive restoring bits depending on
requirement.
2) (55.42)10
Integer part conversion
2 55 27 13 6 3 1
1 1 1 0 1 1 ← MSB
(55.42)10 = (110111.011)2
3) (170.12)10
Integer part conversion
2 170 85 42 21 10 5 2 1
0 1 0 1 0 1 0 1 ← MSB
(170.12)10 = (10101010.00011)2
4) (1220.065)10
Integer part conversion
2 1220 610 305 152 76 38 19 9 4 2 1
0 0 1 0 0 0 1 1 0 0 1 ← MSB
Join Telegram:- @engineeringnotes_mu
(1220.065)10 = (10011000100.000100)2
0 0 0 0 1 1 0 1
↑
Sign Bit
(-13)10
Join Telegram:- @engineeringnotes_mu
1 0 0 0 1 1 0 1
↑
Sign Bit
(+13)10
0 0 0 0 1 1 0 1
↑
Sign Bit
(-13)10
1 1 1 1 0 0 1 0
↑
Sign Bit
0 0 0 0 1 1 0 1
↑
Sign Bit
(-13)10
1 1 1 1 0 0 1 1
↑
Sign Bit
Join Telegram:- @engineeringnotes_mu
Example7: Represent following numbers in signed magnitude, 1’s Complement and 2’s
Complement format.
a) +6 and -6 b) +9 and -9 c) +21 and -21 d) +35 and -35
Solution: Following table shows representation of above numbers.
0+1=1
1+0=1
1 + 1 = 10 here 0 is Sum and 1 is Carry.
Example8: Perform binary addition for following numbers.
a) 101 + 110 b) 1010 and 1011 c) 11001 + 10011 + 10110
d) 110110 + 111101 + 110001 + 110011
Join Telegram:- @engineeringnotes_mu
Solution: a)
1 0 1
+ 1 1 0
_____________________
1 0 1 1
b)
1 ← Carry
1 0 1 0
+ 1 0 1 1
__________________________
1 0 1 0 1
c)
1 0 1 1 1 1 ← Carry
1 1 0 0 1
+ 1 0 0 1 1
+ 1 0 1 1 0
________________________________
1 0 0 0 0 1 0
d)
1 0 } ← Carry
1 0 1 1 1 1
1 1 0 1 1 0
+ 1 1 1 1 0 1
+ 1 1 0 0 0 1
+ 1 1 0 0 1 1
______________________________________
1 1 0 1 0 1 1 1
Subtraction: - To perform binary subtraction operation two methods are used. First method
is using 1’s complement and second method is using 2’s complement.
1’s Complement Method: Following steps are used to perform subtraction operation.
Step1- Convert both numbers in binary format if numbers are not in binary numbers.
Step2- Take 1’s Complement of subtrahend.
Step3- Perform addition operation. (1’s complement method convert number into
negative so perform addition operation.)
Step4- After addition check for following condition
1. If carry is generated then add it into answer to get final answer.
2. If MSB of answer is 1 it indicates that answer is negative.
Join Telegram:- @engineeringnotes_mu
Example9: Perform binary subtraction using 1’s Complement method for following numbers.
1) 1010 – 0100 2) 1001 – 1100 3) 10111 – 11001 4) 110011 – 111011
Solution: 1) 1010 – 0100 = 0110
0100 is subtrahend so take it’s 1’s complement, which is 1011 and perform
addition.
1 1 ← Carry
1 0 1 0
+ 1 0 1 1
1 0 1 0 1
In this example carry is generated so add it into the answer.
0 1 0 1
+ 1
0 1 1 0
2) 1001 – 1100 = 1100
1’ s Complement of 1100 is 0011
1 1 ← Carry
1 0 0 1
+ 0 0 1 1
1 1 0 0
MSB of answer is 1 indicate that answer is negative.
1 1
1 0 1 1 1
+ 0 0 1 1 0
1 1 1 0 1
MSB of answer is 1 indicate that answer is negative.
1 1 0 0 1 1
+ 0 0 0 1 0 0
1 1 0 1 1 1
MSB of answer is 1 indicate that answer is negative.
Join Telegram:- @engineeringnotes_mu
2’s Complement Method: Following steps are used to perform subtraction operation.
Step1- Convert both numbers in binary format if numbers are not in binary numbers.
Step2- Take 2’s Complement of subtrahend.
Step3- Perform addition operation. (2’s complement method convert number into
negative so perform addition operation.)
Step4- After addition check for following condition
1. If carry is generated then ignore it.
2. If MSB of answer is 1 it indicates that answer is negative.
Example10: Perform binary subtraction using 2’s Complement method for following
number.
1) 1011 – 0101 2) 1000 – 1100 3) 10101 – 11101 4) 100001 – 111100
1 1 1
1 0 1 1
+ 1 0 1 1
1 0 1 1 0
Carry is generated, ignore it.
1 0 0 0
+ 0 1 0 0
1 1 0 0
As Sign bit of answer is 1, indicate that number is negative.
1 1 1
1 0 1 0 1
+ 0 0 0 1 1
1 1 0 0 0
Join Telegram:- @engineeringnotes_mu
1 0 0 0 0 1
+ 0 0 0 1 0 0
1 0 0 1 0 1
1 0 1 0 Multiplicand
X 1 0 1 1 Multiplier
1 0 1 0 Partial Product-I
+ 1 0 1 0 x Partial Product-II
+ 0 0 0 0 x x Partial Product-III
+ 1 0 1 0 x x x Partial Product-IV
1 1 0 1 1 1 0 Final Product
Division: -Binary division is also similar to decimal division in which dividend is divided by
divisor and we get answer as quotient and reminder.
Example: - Divide 11110101 by 1000
Solution: -
11110
__________
1000) 11110101
1000
1110
1000
1101
1000
1010
1000
101
Join Telegram:- @engineeringnotes_mu
Solution: For converting the number (456)8 into decimal expand it.
(456)8 = 4X82 + 5X81 + 6X80
= 256 + 40 + 6
= (302)10.
Example12: Convert following Octal numbers to the decimal numbers.
1) (23)8 2) (271.12)8 3) (1234.051)8 4) (765.43)8
Solution: 1) (23)8 = 2X81 + 3X80
= 16 + 3
= (19)10
2) (271.12)8 = 2X82 + 7X81 + 1X80 +1X8-1 + 2X 8-2
= 128 + 56 + 1 + 0.125 + 0.125
= (185.25)10
3) (1234.051)8 = 1X83 + 2X82 + 3X81 + 4X80 + 0X8-1 + 5X8-2 + 1X8-3
= 512+ 128 + 24 + 4 + 0.3125 + 0.00195
= (668.31445)10
4) (765.43)8 = 7X82 + 6X81 + 5X80 + 4X8-1 + 3X8-2
= 448 + 48 + 5 + 0.5 + 0.0468
= (501.5468)10
1) (46)10
8 46 5
6 5 ← MSB
(46)10 = (56)8
2) (789)10
8 789 98 12 1
5 2 4 1 ← MSB
(789)10 = (1425)8
3) (92.54)10
4) (969.8935)10
(969.8935)10 = (1711.7113)8
Join Telegram:- @engineeringnotes_mu
3) (1234)8 = (001010011100)2
4) (76342)8 = (111110011100010)2
4) (1010101.1101)2 = (1 010 101 .110 1)2 ( 001 010 101 .110 100 )2
= (125.64)8
110 100
+ 101 011
____________
1 011 111
1 3 7
101 ←Carry
110 100
+ 010 101
____________
Carry→ 1 001 001
1 1 1 1 ←Carry
011001111
+ 011100011
______________
110110010
As MSB of answer is 1 means it is negative to get original answer take 2’s complement
and attached minus sign.
(110110010)2 2’s Complement is (001 001 110)2 = (-116)8
= 80 + 6
= (86)10.
Example19: Convert following Hexadecimal numbers to the decimal numbers.
1) (253H) 2) (27A.12H) 3) (1B3F.01) 4) (ABC.DF)
Solution: 1) (253H) = 2X162 + 5X161 3X160
= 512 + 80 + 3
= (595)10
16 16 1
0 1 ← MSB
(16)10 = (10H)
2) (759)10
16 759 47 2
7 F 2 ← MSB
(759)10 = (2F7H)
3) (262.64)10
4) (918.12)10
First convert integer part of number that is 918.
16 918 57 3
6 9 3 ← MSB
(918)10 = (396H)
Fractional part conversion
2) (4BCH) – (2DEH)
For subtraction operation take 2’s complement of subtrahend and perform
addition operation.
(2DEH) = (1011011110)2
2’s Complement of (0010 1101 1110)2 is (1101 0010 0010)
AB = 10101011
X CD = X 11001101
88EF = 10101011
00000000x
10101011xx
10101011xxx
00000000xxxx
00000000xxxxx
10101011xxxxxx
10101011xxxxxxx
1000 1000 1110 1111
2.6 Codes
Codes are used to represent information, information may be numbers, alphabets, symbols.
Within digital systems like computer information required for processing and storage
in binary for that various binary codes are available. Example of binary codes are BCD code,
ASCII code, Excess-3 code, Gray code, EBCDIC etc. Information store in one particular code
may have different meaning in another code.
Join Telegram:- @engineeringnotes_mu
BCD Arithmetic: - BCD code is the method to represent decimal numbers in binary means
when decimal input is given to computer in accept in BCD format but if performing
processing on it, gives the invalid/incorrect BCD number so for converting it into correct BCD
some rules are used which are as follow.
BCD Addition: - BCD addition is performed for two 1-bit number, if answer is greater than 9
or carry is generated then it is invalid BCD to correct it into correct BCD, ADD 6.
Example24: - Add following BCD numbers.
1) 5 + 3 2) 6 + 7 3) 9 + 8
Solution: - 1) 5 + 3
0101 (5 in BCD)
+ 0011 (3 in BCD)
1000 (8 in BCD ) < 9, Correct BCD
2) 6 + 7
0110 (6 in BCD)
+ 0111 (7 in BCD)
1101 (13 in Binary) > 9, Invalid BCD
+ 0110 Add 6, To get Correct BCD
10011 (13 in BCD)
Join Telegram:- @engineeringnotes_mu
3) 9 + 8
1001 (9 in BCD)
+ 1000 (8 in BCD)
1 0001 (1 in BCD) < 9, but carry is generated, invalid BCD
+ 0110 Add 6, to get Correct BCD
1 0111 (17 in BCD)
BCD Subtraction: - BCD subtraction is performed by converting subtrahend into it’s negative
format like for binary number in 1’s or 2’s complement format. Similar to this for decimal
number 9’s complement method is used. For calculating 9’s complement of number subtracts
the number from 9. The 9’s complement of number 5 is 9 – 4 = 5 and number 6 is 9 – 6 = 3.
Procedure for BCD subtraction: -
1 Take 9’s complement of subtrahend.
2. Perform of addition minuend and subtrahend.
3. Result of subtraction will be either invalid BCD then add 6 with carry of this addition or
valid BCD then take 9’s complement of answer.
Example: - Perform BCD subtraction for following numbers.
1) 7 – 2 2) 9 – 3 3) 2 – 7 4) 7 – 9
Solution: - 1) 7 – 2
0 1 1 1 (7 in BCD)
+ 0111 9’s Complement of 2.
1 1 1 0 (14 in Binary) > 9, invalid BCD
+ 0110 Add 6
1 0100 Carry is generated
+ 1 Add carry
0101 (5 in BCD)
2) 9 – 3
1001 (9 in BCD)
+ 0110 9’s Complement of 3,
1111 (15 in Binary) > 9, invalid BCD
+ 0110 Add 6
1 0101 Carry is generated
+ 1 Add carry
0110 (6 in BCD)
3) 2 – 7
0010 (2 in BCD)
+ 0010 9’ Complement of 7
0100 (4) < 9, Valid BCD
0101 9 ‘s Complement of 4
Join Telegram:- @engineeringnotes_mu
4) 7 – 9
0111 (7 in BCD)
+ 0000 9’s Complement of 9
0111 (7) < 9, Valid BCD
0010 9’s Complement of 7
Excess-3 Code: -
Excess-3 code is generated by adding 3 to each decimal digit. This code is not weighed code
like BCD code. BCD code is weighted because every digit is having values either of 8, 4, 2, 1.
For example Excess-3 code for 4 will be 0100 + 0011 = 0111. This code is self-complementing
code. For example Excess-3 code of 4 is 0100 + 0011 = 0111 and it’s 1’s complement is 1000
which is Excess-3 code of 9’s complement of 4 i.e. 5(1000).
Following table gives Excess-3 codes for the decimal numbers.
Decimal Numbers Excess-3 Codes
0 0011
1 0100
2 0101
3 0110
4 0111
5 1000
6 1001
7 1010
8 1011
9 1100
Gray Codes: -
Gray code is differing by only one bit from its preceding and succeeding numbers so also
known as unit distance code. For example, BCD code for 3 is 0011 and for 4 is 0100, these two
succeeding number differ at 3-digit places except MSB digit all other digit are differing, which
is not expected in Gray code. Gray code is useful in error detection code. Gray code is non-
weighted code. If we consider 4-bit binary number as B (B3B2B1B0) and Gray code G (G3G2G1G0)
then G3 = B3, G2 = B3 ExOR B2, G1 = B2 ExOR B1 and G0 = B1 ExOR B0.
Following table gives Gray code for 4-bit binary numbers
Binary Numbers Gray Codes
B3 B2 B1 B0 G3 G2 G1 G0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
Join Telegram:- @engineeringnotes_mu
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
ASCII Code: - American Standard Code for Information Interchange (ASCII) code is 7-digit code
used to represent numbers, alphabets (Uppercase and Lowercase), special symbols, etc.
7-digits unique code is assigned to every character represented in ASCII code, as length of
each code is 7-bit so 27 = 128 total characters are represented in ASCII code.
Following table represent ASCII codes.
Join Telegram:- @engineeringnotes_mu
Registers in Computer Architecture
Register is a very fast computer memory, used to store data/instruction in-execution.
A Register is a group of flip-flops with each flip-flop capable of storing one bit of information.
An n-bit register has a group of n flip-flops and is capable of storing binary information of n-bits.
A register consists of a group of flip-flops and gates. The flip-flops hold the binary information and
gates control when and how new information is transferred into a register. Various types of
registers are available commercially. The simplest register is one that consists of only flip-flops
with no external gates.
1. Accumulator: This is the most common register, used to store data taken out from the
memory.
2. General Purpose Registers: This is used to store data intermediate results during
program execution. It can be accessed via assembly programming.
3. Special Purpose Registers: Users do not access these registers. These registers are for
Computer system,
o MAR: Memory Address Register are those registers that holds the address for
memory unit.
o MBR: Memory Buffer Register stores instruction and data received from the memory
and sent from the memory.
Register Transfer
Information transferred from one register to another is designated in symbolic form by means of
replacement operator.
R2 ← R1
Normally we want the transfer to occur only in predetermined control condition. This can be shown
by following if-then statement: if (P=1) then (R2 ← R1)
P: R2 ← R1
The control condition is terminated with a colon. It shows that transfer operation can be executed
only if P=1.
Micro-Operations
The operations executed on data stored in registers are called micro-operations. A micro-
operation is an elementary operation performed on the information stored in one or more registers.
Types of Micro-Operations
1. Register transfer micro-operations transfer binary information from one register to another.
Arithmetic Micro-Operations
Some of the basic micro-operations are addition, subtraction, increment and decrement.
Add Micro-Operation
R3 R1 + R2
The above statement instructs the data or contents of register R1 to be added to data or content of
register R2 and the sum should be transferred to register R3.
Subtract Micro-Operation
R3 R1 + R2' + 1
In subtract micro-operation, instead of using minus operator we take 1's compliment and add 1 to
the register which gets subtracted, i.e R1 - R2 is equivalent to R3 → R1 + R2' + 1
Increment/Decrement Micro-Operation
Join Telegram:- @engineeringnotes_mu
Increment and decrement micro-operations are generally performed by adding and subtracting 1
to and from the register respectively.
R1 R1 + 1
R1 R1 – 1
Logic Micro-Operations
These are binary micro-operations performed on the bits stored in the registers. These operations
consider each bit separately and treat them as binary variables.
X-OR micro-operation
Consider the X-OR micro-operation with the contents of two registers R1 and R2.
R1 ← R1 X-OR R2
Shift Micro-Operations
These are used for serial transfer of data. That means we can shift the contents of the register to
the left or right. In the shift left operation the serial input transfers a bit to the right most position
and in shift right operation the serial input transfers a bit to the left most position.
a) Logical Shift
It transfers 0 through the serial input. The symbol "shl" is used for logical shift left and "shr" is
used for logical shift right.
R1 ← shl R1
R1 ← shr R1
This circulates or rotates the bits of register around the two ends without any loss of data or
contents. In this, the serial output of the shift register is connected to its serial
input. "ROL" and "ROR" is used for rotate (circular shift) left and right respectively.
c) Arithmetic Shift
This shifts a signed binary number to left or right. An arithmetic shift left multiplies a signed
binary number by 2 and shift left divides the number by 2. Arithmetic shift micro-operation leaves
the sign bit unchanged because the signed number remains same when it is multiplied or divided
by 2.
Computer Instructions
Computer instructions are a set of machine language instructions that a particular processor
understands and executes (Instruction is a command given to Computer to perform specific task.).
A computer performs tasks on the basis of the instruction provided.
Instruction Format
1) 3 – Address machine
2) 2 – Address machine
3) 1 – Address machine
4) 0 – Address machine
1) 3 – Address machine
The instruction having three operands is known as 3-address machine.
In this type of instruction operand2 and operand3 perform specified operation which are
source register and result is store in operand3 register, which is destination register.
2) 2 – Address machine
The instruction having two operands is known as 2-address machine.
Join Telegram:- @engineeringnotes_mu
OPCODE OPERAND1 OPERAND2
In this type of instruction operand1 and operand2 perform specified operation which are
source register and result is store in operand1 register, which is destination register.
3) 1 – Address machine
The instruction having only one operand is known as 1-address machine.
OPCODE OPERAND
In this type of instruction one operand is in accumulator register and another operand is
instruction it perform specified operation which are source register and result is store in
accumulator register, which is destination register.
4) 0 – Address machine
The instruction having no operand is known as 0- address machine or Stack Machine.
OPCODE
This type of instructions performs operations with stack. One Operands is on top of the
stack and another operand on top of stack minus one and result is stored on top of the
stack.
In Memory-reference instruction, 12 bits of memory is used to specify an address and one bit to
specify the addressing mode 'I'.
Example:- MOV R, M (R) ← (M)
MOV M, R (M) ← (R)
2. Register - reference instruction
Join Telegram:- @engineeringnotes_mu
The Register-reference instructions are represented by the Opcode 111 with a 0 in the leftmost bit
(bit 15) of the instruction.
Note: The Operation code (Opcode) of an instruction refers to a group of bits that define arithmetic and
logic operations such as add, subtract, multiply, shift, and compliment.
3. Input-Output instruction
Just like the Register-reference instruction, an Input-Output instruction does not need a reference
to memory and is recognized by the operation code 111 with a 1 in the leftmost bit of the
instruction. The remaining 12 bits are used to specify the type of the input-output operation or test
performed.
Note
o The three operation code bits in positions 12 through 14 should be equal to 111. Otherwise,
the instruction is a memory-reference type, and the bit in position 15 is taken as the
addressing mode I.
o When the three operation code bits are equal to 111, control unit inspects the bit in position
15. If the bit is 0, the instruction is a register-reference type. Otherwise, the instruction is an
input-output type having bit 1 at position 15.
Arithmetic, logic and shift instructions provide computational capabilities for processing the type of
data the user may wish to employ.
A huge amount of binary information is stored in the memory unit, but all computations are done in
processor registers. Therefore, one must possess the capability of moving information between
these two units.
Program control instructions such as branch instructions are used change the sequence in which
the program is executed.
Input and Output instructions act as an interface between the computer and the user. Programs
and data must be transferred into memory, and the results of computations must be transferred
back to the user.
Addressing Modes:
The operation field of an instruction specifies the operation to be performed. And this operation
must be performed on some data. So, each instruction needs to specify data on which the
operation is to be performed. But the operand(data) may be in accumulator, general purpose
register or at some specified memory location. So, appropriate location (address) of data is need
to be specified, and in computer, there are various ways of specifying the address of data. These
various ways of specifying the address of data are known as “Addressing Modes”
Implied Addressing Mode also known as "Implicit" or "Inherent" addressing mode is the
addressing mode in which, no operand (register or memory location or data) is specified in the
instruction. As in this mode the operands are specified implicit in the definition of instruction.
In Immediate Addressing Mode operand is specified in the instruction itself. In other words, an
immediate mode instruction has an operand field rather than an address field, which contain actual
operand to be used in conjunction with the operand specified in the instruction.
MOV AH, 06H Move 06H to the higher byte of accumulator register
ADD AL, 05H ADD 05H to the lower byte of accumulator register
This mode is very useful for initialising the register to a constant value.
Here, AX, BX, CX, DX are used as register names which is of 16-bit register.
Direct Addressing Mode is also known as “Absolute Addressing Mode”. In this mode the address
of data(operand) is specified in the instruction itself. That is, in this type of mode, the operand
resides in memory and its address is mention directly within instruction.
In this instruction add contents of memory location 1000H to the AX (accumulator) and result is
stored in AX (accumulator). In this instruction 1000H is memory address not a data.
Indirect Addressing Mode, the operand is stored in memory, but within instruction register is used
to store memory address. That’s why also known as register indirect addressing mode.
MOV BX, [CX] (BX) (CX), where (CX) = 7000H & (7000H) = 1234H
In above instruction memory address 7000H is stored in register CX and memory location 7000H
having data 1234H, which is transfer to the BX register.
Join Telegram:- @engineeringnotes_mu
Other examples of indirect addressing mode are, Base Addressing mode, Index Addressing mode,
Base Index addressing mode.
In case of base addressing mode base registers and for index addressing mode index registers
and concern registers are used to give operand address.
In base index addressing mode, base register, index registers and concern registers are used to
give operand address.
Fetch cycle: In this cycle, the processor reads the instruction that is to be
executed from the memory.
Execute cycle: In this cycle, the processor interprets the opcode of the fetched
instruction and performs the operations accordingly.
In the basic computer, each instruction cycle includes the following procedures −
As shown in the figure, the halt condition appears when the device receive turned off, on the
circumstance of unrecoverable errors, etc.
Fetch Cycle
The address instruction to be implemented is held at the program counter. The processor fetches
the instruction from the memory that is pointed by the PC.
Join Telegram:- @engineeringnotes_mu
Next, the PC is incremented to display the address of the next instruction. This instruction is
loaded onto the instruction register. The processor reads the instruction and executes the
important procedures.
Execute Cycle
The data transfer for implementation takes place in two methods are as follows −
Processor-memory − The data sent from the processor to memory or from memory to
processor.
Processor-Input/Output − The data can be transferred to or from a peripheral device by
the transfer between a processor and an I/O device.
In the execute cycle, the processor implements the important operations on the information, and
consistently the control calls for the modification in the sequence of data implementation. These
two methods associate and complete the execute cycle.
Figure1: General structure of (a) a hardwired and (b) microprogrammed control unit.
Basic Concepts:
An instruction is implemented by a sequence of one or more sets of concurrent microinstructions. Each microoperation
is associated with a group of control lines that can be activated in a prescribe sequence to trigger the microoperations.
As the number of instructions and control lines can be in the hundreds, a hardwired control unit is difficult to design and
verify. Furthermore, such control design is inherently inflexible in the sense that changes, for example, to correct design
errors or update the instruction set, required that the control unit be redesigned.
Microprogramming is a method of control-unit design in which the control signal selection and sequencing
information is stored in a ROM or RAM called a control memory (CM). the control signals can be activated at any time
are specified by a microinstruction, which is fetched from CM in much the same way an instruction is fetched from main
memory. Each microinstruction also explicitly or implicitly specifies the next microinstruction to be used, thereby
providing the necessary information for microoperation sequencing. A set of related microinstructions forms a
microprogram. Microprograms can be changed relatively easily by changing the content of CM.
In its simplest form a microinstruction has two parts: a set of control fields that specify the control signals to be
activated and an address field that contains the address in CM of the next microinstruction to be executed.
Microprogramming is invented by Maurice V. Wilkes, so microprogramming also known as Wilkes Design.
In microprogramming, each bit ki of a control field correspond to a distinct control lines ci . when ki = 1 in the current
microinstruction, ci is activated; otherwise ci remain inactive. Figure2 shows a microprogrammed control unit designed
in this style.
Join Telegram:- @engineeringnotes_mu
The control memory CM is implemented by ROM, left part (AND plane) of the ROM decodes an address obtain from the
control memory address register (CMAR). Each address selects a particular row in the right part (OR plane) of the ROM
that contains a microinstruction composed (in this small example) of a 6-bits control field and a 3-microinstruction with
address 000, is selected, the control signals c0, c2, and c4 are activated by the xs in the control field. At the same time, the
contents of the address field a2a1a0 = 001 are sent to the CMAR, where they are stored and used to address the next
microinstruction to be executed.
As Figure2 indicates, the CMAR can be loaded from an external source as well as from address field of a
microinstruction. The external source typically provides the starting address of microprogram in the CM. a specific
microprogram prestored in CM executes each instruction of a microprogrammed CPU. The instruction’s opcode, after
encoding, provides the starting address for its microprogram.
Every program control unit should be able to respond to external signal or conditions. We can satisfy this
requirement by introducing some sort of switch S controlled by an external condition that allows the current
microinstruction to select one of two possible address fields. Thus, in Figure2, the third microinstruction may be
followed by the microinstruction with address 100 or 101. as determined by the external condition. This feature makes
conditional branches within a microprogram possible.
Many modifications to the preceding design have been proposed over the year. A major of concern is the
microinstruction’s word length, since it greatly influences the size and cost of the CM. microinstruction length is
determined by three factors:
Join Telegram:- @engineeringnotes_mu
The maximum number of simultaneous microoperation that must be specified, that is, the degree of parallelism
required at the microoperation level.
The way in which the control information is represented or encoded.
The way in which the next microinstruction address is specified.
The control memory is generally ROMs, so their content cannot be altered online. Normally there is no need to change
CM except to correct design or to make minor enhancement to the system. It was recognized from beginning however,
that the CM could be read-write memory (RAM). Wilkes observed that such device, called a writable control memory
(WCM), would have the number of “fascinating possibilities,” but doubled the cost. The most interesting feature of
WCM is that it allows us to change a processor instruction set by changing the microprogram that interpret the
instruction set.
Parallelism in microinstructions:
Microprogrammed processors are frequently characterized by the maximum number of microoperations that a single
microinstruction can specify. This number range from one to hundred.
Microinstructions that specify a single microoperation are similar to the conventional machine instructions. They
are relatively short, due to lack of parallelism, more microinstructions are needed to perform a given operation. The
short microinstruction format is shown in Figure3. It consists of 4 bytes (32 bits). The left most byte (shaded) is an
opcode that specifies the microoperation has to be performed. The next 2 bytes specify the operands, which, in most
cases, are the address of CPU registers. The right most byte contains information used to construct the address of the
next microinstruction.
Horizontal microinstruction format takes advantage of the fact that, at the microprogramming level, many operations
can be performed in parallel. If all the useful combinations of parallel microoperation were specified by the single
opcode, the number of opcodes would, in most cases. Be enormous. Furthermore, an opcode decoder of considerable
complexity would be needed. To avoid these difficulties, it is usual to divide the microoperation specification part of a
microinstruction into k disjoint control fields. Each control field handles a limited set of microinstructions, any one of
which can be performed simultaneously with the microoperations specified by the remaining control field.
Join Telegram:- @engineeringnotes_mu
Figure4 shows horizontal microinstruction format, which is 90 bits. It is partitioned into separate fields for
various purposes. There are 21 fields, shown shaded in Figure4, which constitute the control fields. The remaining fields
are used to generate the next microinstruction address and to detect errors by means of parity bits. For example, the 3
bits control fields consisting of bits 65:67 controls the right input to the main adder of the CPU in question. This field
indicate which of several possible registers should be connected to the adder’s right input. Bits 68:71 identify the
function to be performed by the adder; the possibilities include binary addition and decimal addition with various ways
of handling input and carry bits.
.
Comparison between hardwired and Micro-programmed Control:
Join Telegram:- @engineeringnotes_mu
Operand fetch phase is use to fetch operand from memory. It is applicable whenever operand is in memory, if
operand is in instruction or in registers then this operation is not required.
Execution cycle is for performing predefines operation by op-code (mnemonic) and it is compulsory.
Micro-Instructions Descriptions
MAR PC The next instruction address is transferred from PD to MAR.
MDR M(MAR) The content of memory address is transferred to the MDR register.
PC PC + 1 The PC is incremented by 1 (assuming length of instruction as a 1.)
IR MDR (Opcode) Opcode is stored into IR register.
Figure: 4.2
1) ADD R1, R2
Instruction fetch Phase: Figure 4.2
Operand fetch: Not applicable as both operands are in registers.
Execution cycle: As follows
Micro-Instructions Descriptions
Y R1 R1 Register content is transferred to the temporary register Y.
Z Y + R2 R2 Register content is added with Y register result is stored in
temporary register Z.
R1 Z Z content is transferred to destination register R1.
2) ADD R1, 50
Instruction fetch Phase: Figure 4.2
Join Telegram:- @engineeringnotes_mu
Operand fetch: Not applicable as operand is within instruction as a constant(50).
Execution cycle: As follows
Micro-Instructions Descriptions
R1 R1 + 50 Constant 50 is added with content of R1 and result is stored in
register R1.
3) ADD R1, M
Instruction fetch Phase: Figure 4.2
Operand fetch: As follows
Micro-Instructions Descriptions
MAR M Operand M (which is in memory) address is transferred to the
MAR.
MDR M(MAR) The content of memory address is transferred to the MDR register.
4) SUB (R3), R4
Instruction fetch Phase: Figure 4.2
Operand fetch: As follows
Micro-Instructions Descriptions
MAR R3 Memory Operand whose address is in register R3 is transferred to
the MAR.
MDR M(MAR) The content of memory address is transferred to the MDR register.
5) JN L1
Instruction fetch Phase: Figure 4.2
Operand fetch: Not applicable as operands is label, which is memory location pointed by PC
whenever condition is true means negative.
Execution cycle: As follows
Micro-Instructions Descriptions
If negative flag is set then If the flag bit indicates that the result of execution of the
PC MDR (operand) previous instruction had been negative then control will be
transferred to the label L1. L1 will appear as an operand in
the current instruction.
6) JMP L1
Instruction fetch Phase: Figure 4.2
Operand fetch: Not applicable as operands is label, which is memory location pointed by PC
5. Memory Organization
A memory unit is the collection of storage units or devices together. The
memory unit stores the binary information in the form of bits. Generally,
memory/storage is classified into 2 categories:
Memory Characteristics: -
1. Memory Types:
The information storage components of a computer can be stored in four
groups, as shown below.
CPU Registers: These high-speed registers in the CPU serve as the working
memory for temporary storage of information and data. They usually general-
purpose registers. This is also known as internal processor memory.
Main (primary) Memory: This large, fairly fast external memory stores
programs and data that are in active use, storage locations in main memory
are addressed directly by the CPU’s load and store instructions. Main memory
is made up of RAM and ROM.
SRAM: Static RAM, has a six-transistor circuit in each cell and retains
data, until powered off.
NVRAM: Non-Volatile RAM, retains its data, even when turned off.
Example: Flash memory.
Secondary Memory: This memory type is much large in capacity but also much
slower than main memory. Secondary memory stores system programs, large
data files, and the like that are not continually required by the main memory is
executed.
Cache Memory: Cache memory is fast and small in size connected between
CPU registers and main memory.
2. Access Modes:
A fundamental characteristic of a memory is the order or sequence in
which information can be accessed.
Volatile Memory: This loses its data, when power is switched off.
Non-Volatile Memory: This is a permanent storage and does not lose any
data when power is switched off.
Types of RAM
RAM (Random Access Memory) is a part of computer’s Main Memory which is
directly accessible by CPU. RAM is used to Read and Write data into it which is
accessed by CPU randomly. RAM is volatile in nature, it means if the power goes
off, the stored information is lost. RAM is used to store the data that is currently
processed by the CPU. Most of the programs and data that are modifiable are
stored in RAM.
Integrated RAM chips are available in two form:
1. SRAM(Static RAM)
2. DRAM(Dynamic RAM)
Static memories (SRAM) are memories that consist of circuits capable of retaining
their state as long as power is on. Thus this type of memories is called volatile
memories. The below figure shows a cell diagram of SRAM. A latch is formed by
two inverters connected as shown in the figure. Two transistors T1 and T2 are used
for connecting the latch with two bit lines. The purpose of these transistors is to act
as switches that can be opened or closed under the control of the word line, which
is controlled by the address decoder. When the word line is at 0-level, the
transistors are turned off and the latch remains its information. For example, the
cell is at state 1 if the logic value at point A is 1 and at point B is 0. This state is
retained as long as the word line is not activated.
Join Telegram:- @engineeringnotes_mu
For Read operation, the word line is activated by the address input to the address
decoder. The activated word line closes both the transistors (switches) T1 and T2.
Then the bit values at points A and B can transmit to their respective bit lines. The
sense/write circuit at the end of the bit lines sends the output to the processor.
For Write operation, the address provided to the decoder activates the word line
to close both the switches. Then the bit value that to be written into the cell is
provided through the sense/write circuit and the signals in bit lines are then stored
in the cell.
DRAM stores the binary information in the form of electric charges that applied to
capacitors. The stored information on the capacitors tend to lose over a period of
time and thus the capacitors must be periodically recharged to retain their usage.
The main memory is generally made up of DRAM chips.
DRAM Memory Cell: Though SRAM is very fast, but it is expensive because of its
every cell requires several transistors. Relatively less expensive RAM is DRAM, due
to the use of one transistor and one capacitor in each cell, as shown in the below
figure., where C is the capacitor and T is the transistor. Information is stored in a
DRAM cell in the form of a charge on a capacitor and this charge needs to be
periodically recharged.
voltage is applied to the bit line. This causes a known amount of charge to be
stored in the capacitor. After the transistor is turned off, due to the property of the
capacitor, it starts to discharge. Hence, the information stored in the cell can be
read correctly only if it is read before the charge on the capacitors drops below
some threshold value.
Types of DRAM:
There are mainly 5 types of DRAM:
performs its operations on the rising edge of the clock signal. Since they transfer
data on both edges of the clock, the data transfer rate is doubled. To access the
data at high rate, the memory cells are organized into two groups. Each group is
accessed separately.
4. Rambus DRAM (RDRAM): The RDRAM provides a very high data transfer rate
over a narrow CPU-memory bus. It uses various speedup mechanisms, like
synchronous memory interface, caching inside the DRAM chips and very fast signal
timing. The Rambus data bus width is 8 or 9 bits.
5. Cache DRAM (CDRAM): This memory is a special type DRAM memory with an on-
chip cache memory (SRAM) that acts as a high-speed buffer for the main DRAM.
Cache Main
CPU Memory Memory
(M1) (M2)
C=
Where c1 denotes cost per bit of M1 and S1 denotes the storage capacity in
bits of M1 and c2 denotes cost per bit of M2 and S2 denotes the storage
capacity in bits of M2.
H=
Let tA1 and tA2 be the access times of M1 and M2, respectively, relative to the
CPU. The average time tA for the CPU to access a word in the 2-level memory
is given by
in the most 2-level memory hierarchies, a request for a word not in the fast
level M1 causes a block of information containing the requested word to be
transferred to M1 from M2. When block transfer has been completed, the
requested word is available in M1. The time tB required for the block transfer
is called the block-access or blocked transfer time. Hence we can write
tA2 = tB + tA1 submitting into the above expression, we get
tA = tA1 + (1-H) tB
In many cases tA2 > > tA1 therefore, tA2 = tB. For example, a block transfer
from secondary to main memory requires a relatively slow IO operation,
making tA2 and tB much greater than tA1
Let r = tA2/tA1, denotes access time ratio for 2- level memory. Let access
efficiency e = tA1/tA
e= = ( )
= ( )
where r = tA2/tA1
( )
Join Telegram:- @engineeringnotes_mu
Example1:- A 2-level memory hierarchy (M1,M2) has the access time tA1 =
10 sec and tA2 = 10-3 sec. What must be the hit ratio H be in order for the
-8
Solution:- Access time tA1 = 10-8 sec and tA2 = 10-3 sec.
e= ( )
-h < 0.0000053 -1
h > 0.9999947
Example2: Suppose a cache is 10 times faster than maim memory and suppose
that the cache can be used 90% of the time. How much speedup do we gain by
using the cache?
Cache Memory
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Cache Mapping
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Cache Coherence
In one CPU system, two copies of same data, one in cache memory and another in
main memory may become different (inconsistent) is known as cache coherency
or cache inconsistency.
The content of cache and main memory can be altered by more than one device
e.g. CPU can write to cache and input\output module or DMA (Direct Memory
Access) can directly write to main memory. This can result in inconsistencies in
the values of cache and main memories.
Write data in cache as well as main memory. This will always keep the two copy of
data (one in cache and another in main memory) consistent. The disadvantage of
this technique is that a bottleneck is created due to large number of access to the
main memory.
Write back policy, it writes data in cache memory and not to main memory.
Consequently, data in cache memory and main memory may contain different
data. The cache line holds the most recent data, and main memory contains older
data, which has not been updated.
Caches configured as write back caches must use one or more of the dirty bits in
the cache line status information block. When a cache controller in write back
writes a value to cache memory, it sets the dirty bit true. If the core accesses the
cache line at a later time, it knows by the state of the dirty bit that the cache line
contains data not in main memory. If the cache controller evicts a dirty cache line,
it is automatically written out to main memory. The controller does this to
prevent the loss of vital information held in cache memory and not in main
memory.
Join Telegram:- @engineeringnotes_mu
Interleaved Memory:
Interleaved memory implement the concept of accepting more words in a single
memory access cycle. Memory can be partitioned into N seprate memory
modules. Thus N acesses can be carried out
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Join Telegram:- @engineeringnotes_mu
Associative Memory
An associative memory can be considered as a memory unit whose stored data can be
identified for access by the content of the data itself rather than by an address or
memory location.
On the other hand, when the word is to be read from an associative memory, the
content of the word, or part of the word, is specified. The words which match the
specified content are located by the memory and are marked for reading.
From the block diagram, we can say that an associative memory consists of a memory
array and logic for 'm' words with 'n' bits per word.
The functional registers like the argument register A and key register K each have n bits,
one for each bit of a word. The match register M consists of m bits, one for each
memory word.
Join Telegram:- @engineeringnotes_mu
The words which are kept in the memory are compared in parallel with the content of
the argument register.
The key register (K) provides a mask for choosing a particular field or key in the
argument word. If the key register contains a binary value of all 1's, then the entire
argument is compared with each memory word. Otherwise, only those bits in the
argument that have 1's in their corresponding position of the key register are compared.
Thus, the key provides a mask for identifying a piece of information which specifies how
the reference to memory is made.
The following diagram can represent the relation between the memory array and the
external registers in an associative memory.
The cells present inside the memory array are marked by the letter C with two
subscripts. The first subscript gives the word number and the second specifies the bit
position in the word. For instance, the cell Cij is the cell for bit j in word i.
A bit Aj in the argument register is compared with all the bits in column j of the array
provided that Kj = 1. This process is done for all columns j = 1, 2, 3......, n.
If a match occurs between all the unmasked bits of the argument and the bits in word i,
the corresponding bit Mi in the match register is set to 1. If one or more unmasked bits
of the argument and the word do not match, Mi is cleared to 0.
Join Telegram:- @engineeringnotes_mu
Pipeline
Pipelining is the process of accumulating instruction from the
processor through a pipeline. It allows storing and executing
instructions in an orderly process. It is also known as pipeline
processing.
Instruction Pipelining
Instruction pipelining is a technique of organizing the instructions for execution
in such a way that the execution of the current instruction is overlapped by the
execution of its subsequent instruction. Instruction pipelining improves the
performance of the processor by increasing its throughput i.e. number of
instructions per unit time.
In this way, the processor processes each instruction from the start till it
finishes execution and then it fetches the next instruction for instruction. Now
if we divide the instruction execution into stages then it could be divided into:
Instruction fetches: Fetch the instruction from the main memory or cache.
Instruction decoding: The processor interprets instruction and determines
the operation that has to be performed.
Operand fetch: If the execution of the instruction requires operand then the
processor fetches operand from the main memory or cache.
Instruction Execution: The processor performs the desired operation.
Operand Store: The result of execution is stored.
Join Telegram:- @engineeringnotes_mu
This reduces the efficiency of the system. Thus to improve the systems
efficiency instruction pipelining can be implemented. Instruction
pipelining lets different hardware sections to process different instructions
simultaneously.
The figure below shows you how the pipelined instruction reduces the
processing time of several instructions and improves the efficiency of the
system. Notice that the instruction decodes stage of instruction 1 is
overlapped with the instruction fetch stage of instruction 2.
Join Telegram:- @engineeringnotes_mu
Resource Hazards
When two pipelined instructions or even more, want to access the same
resource it results in resource hazards. It is also termed structural hazards. A
solution to this hazard is that these instructions must be executed serially up
to some portion of the pipeline.
Join Telegram:- @engineeringnotes_mu
Let us understand this with the help of an example. Consider the main
memory you have has a single port that restricts the processor to perform
instruction fetch, read data and write data one at a time. This means you
cannot perform the operand read & write operation, from memory in parallel
with instruction fetch.
Now consider that there are three instructions in the pipeline. So in the normal
conditions, the operand fetch of instruction 1 must-have overlapped the
instruction fetch of instruction 3. But there is a case that source operand of
instruction 1 is present in main memory instead of register and the rest of all
the operands are in register. So we would halt the instruction fetch of
instruction 3 for one clock cycle. Because instruction 1 will fetch its source
operand from memory so in the same clock cycle instruction 3 cannot perform
instruction fetch in parallel to operand fetch of instruction 1.
Data Hazards
ADD R1, R2
SUB A, R1
the add result in clock cycle t 4. But the subtract instruction need its operand
R1 at the t3 clock cycle. But if subtract instruction fetches the operand R1 in
the t3 clock cycle then it will generate an incorrect result.
So the subtract instruction must stall or halt for two clock cycles because for
the correct result the subtract instruction is dependent on the result of add
instruction. This dependency is also called data dependency.
Control Hazards
The instruction I1 is fetched in cycle t0, decoded in cycle t1, fetch operands in
cycle t2 and perform execution in cycle t3 where the target address is
computed. But till then three instructions I2, I3 and I4 are pipelined in cycle t1,
t2 and t3 which must be discarded as instruction I1 is branch instruction which
will compel the processor to execute the instruction I9 after instruction I1.
This is how control hazards lead to delay of three cycles t 1, t2 and t3 between
I1 and I 6 which is also termed as branch delay.
Join Telegram:- @engineeringnotes_mu
This branch delay could be minimized if the branches in the instruction could
be predicted at the decoding stage only.
Most computers run synchronously utilizing a CPU clock running at a constant clock rate: Or clock
frequency: f
f = 1/c
• The CPU clock rate depends on the specific CPU organization (design) and hardware
implementation technology (VLSI) used.
– A micro operation is an elementary hardware operation that can be performed during one CPU
clock cycle.
– Examples: register operations: shift, load, clear, increment, ALU operations: add , subtract, etc.
• Thus: A single machine instruction may take one or more CPU cycles to complete termed as the
Cycles Per Instruction (CPI).
• Average (or effective) CPI of a program: The average CPI of all instructions executed in the program on a given CPU
design.
Tk = [ k + (n-1)]
T1 = nk
Speedup factor
T
_______
1
nk
___________________ nk
________________
Sk = =
Tk [ k + (n-1)] = k + (n-1)
S k n
Ek =
________
= _____________
k k + (n-1)
Pipeline throughput (the number of tasks per unit time) :
Amdahl’s Law
Suppose, Moni have to attend an invitation. Moni’s another two friend Diya and Hena are also invited.
There are conditions that all three friends have to go there separately and all of them have to be
present at door to get into the hall. Now Moni is coming by car, Diya by bus and Hena is coming by
foot. Now, how fast Moni and Diya can reach there it doesn’t matter, they have to wait for Hena. So to
speed up the overall process, we need to concentrate on the performance of Hena other than Moni or
Diya.
This is actually happening in Amdahl’s Law. It relates the improvement of the system’s performance
with the parts that didn’t perform well, like we need to take care of the performance of that parts of the
Join Telegram:- @engineeringnotes_mu
systems. This law often used in parallel computing to predict the theoretical speedup when using
multiple processors.
Formula
Amdahl’s Law can be expressed in mathematically as follows −
SpeedupMAX = 1/((1-p)+(p/s))
SpeedupMAX = maximum performance gain
s = performance gain factor of p after implement the enhancements.
p = the part which performance needs to be improved.
Let’s take an example, if the part that can be improved is 30% of the overall system and its
performance can be doubled for a system, then −
SpeedupMAX = 1/((1-0.30)+(0.30/2))
= 1.18
Now, in another example, if the part that can be improved is 70% of the overall system and its
performance can be doubled for a system, then −
SpeedupMAX= 1/((1-0.70)+(0.70/2))
= 1.54
So, we can see, if 1-p can’t be improved, the overall performance of the system cannot be improved
so much. So, if 1-p is 1/2, then speed cannot go beyond that, no matter how many processors are
used.
Multicore programming is most commonly used in signal processing and plant-control systems. In
signal processing, one can have a concurrent system that processes multiple frames in parallel. the
controller and the plant can execute as two separate tasks, in plant-control systems.
Multicore programming helps to split the system into multiple parallel tasks, which run simultaneously,
speeding up the overall execution time.
Flynn’s Classification:
Multiprocessing can be defined using Flynn’s classification, it is based on multiplicity of
instruction stream and data streams in a computer system.
An instruction stream is a sequence of instruction executed by computer.
A data stream in a sequence of data which includes input data or temporary results.
Single instruction: Only one instruction stream is being acted or executed by CPU during one clock
cycle.
Single data stream: Only one data stream is used as input during one clock cycle.
Join Telegram:- @engineeringnotes_mu
A SISD computing system is a uniprocessor machine that is capable of executing a single instruction
operating on a single data stream. Most conventional computers have SISD architecture where all the
instruction and data to be processed have to be stored in primary memory.
A SIMD system is a multiprocessor machine, capable of executing the same instruction on all the
CPUs but operating on the different data stream.
Join Telegram:- @engineeringnotes_mu
3) MISD (Multiple Instruction Single Data stream)
A MIMD system is a multiprocessor machine that is capable of executing multiple instructions over
multiple data streams. Each processing element has a separate instruction stream and data stream.
Join Telegram:- @engineeringnotes_mu
Expansion Buses
The expansion bus allows the CPU to communicate with peripheral devices. Expansion
bus and associated slots are required because basic PC system cannot satisfy all
needs of users. Expansion bus slots or I/O bus designs in general, provide the
opportunity to add more devices to PC. We can plug sound cards, video cards, SCSI
controller cards, network interface cards, etc. Into expansion bus slots provided on PC
motherboard.
3. Expansion bus determines what exactly can be added to system – how many add-
on cards, how much memory on expansion cards, what other system components
and how easy it will be to setup system.
4. It provide a common pathway for data, address and control signals that links various
components of PC.
5. Bus design also has to assure that data actually goes to place where it is meant to
go, i.e. through bus circuits computer sends definite patterns of digital bits in a
definite sequence from one point to another.
6. Expansion bus provides special signals to synchronize working of add-on cards with
the rest of the computer.
In modern PCs, a number of basic peripheral devices are built into motherboard. As a
result, it may happen that expansion slots may remain unused, but that doesn’t mean
that expansion buses remain unused in that system. All built-in controllers and ports still
use I/O bus to communicate with CPU, i.e. They operate in such a way as it they are
add-on cards plugged into the system’s expansion bus slots.
Since introduction of first PC till, a number of expansion bus types have appeared on
PC platform with basic objective of providing faster I/O speeds for better system
performance. The need for better performance arises mainly due to improvements in
three main areas :
Faster processors
Increasing application software requirements
Faster multimedia requirements in audio and video
Faster peripherals.
It is also called as "AT bus", ISA was one of the first expansion buses for PCs.
Providing the hardware interface for connecting peripheral devices in PCs, ISA
accepted cards for sound, display, hard drives and other devices. ISA allowed for
additional expansion cards to be attached to a computer's motherboard and was
capable of direct memory access (DMA), with multiple expansion cards on a memory
Join Telegram:- @engineeringnotes_mu
channel and separate interrupt request (IRQ) assignment for each card. The
development and use of ISA led to several later technologies.
Features:-
Types of PCI :
These are various types of PCI:
PCI 32 bits have a transport speed of 33 MHz and work at 132 MBps.
PCI 64 bits have a transport speed of 33 MHz and work at 264 MBps.
PCI 64 bits have a transport speed of 66 MHz and work at 512 MBps.
PCI 64 bits have a transport speed of 66 MHz and work at 1 GBps.
Function of PCI :
PCI slots are utilized to install sound cards, Ethernet and remote cards and presently
strong state drives utilizing NVMe (Nonvolatile Memory express) innovation to supply
SSD (Solid State Drive) drive speeds that are numerous times speedier than SATA
(Serial Advanced Technology Attachment) SSD speeds. PCI openings too permit
discrete design cards to be included to a computer as well.
PCI openings (and their variations) permit you to include expansion cards to a
motherboard. The extension cards increment the machines capabilities past what the
motherboard may create alone, such as: upgraded illustrations, extended sound,
expanded USB and difficult drive controller, and extra arrange interface options, to title
a couple of.
Advantage of PCI :
You’ll interface a greatest of five components to the PCI and you’ll be able
moreover supplant each of them by settled gadgets on the motherboard.
You have different PCI buses on the same computer.
The PCI transport will improve the speed of the exchanges from 33MHz to
133 MHz with a transfer rate of 1 gigabyte per second.
Join Telegram:- @engineeringnotes_mu
The PCI can handle gadgets employing a greatest of 5 volts and the pins
utilized can exchange more that one flag through one stick.
Disadvantage of PCI :
1. USB 1.x
2. USB 2.0
3. USB 3.x
USB 2.0 has multiple updates and additions. The USB Implementer Forum (USB
IF) currently maintains the USB standard and it was released in 1996.
USB was designed to standardize the connection of peripherals like pointing
devices, keyboards, digital still, and video cameras. But soon devices such as
printers, portable media players, disk drives, and network adaptors to personal
computers used USB to communicate and to supply electric power. It is
commonplace to many devices and has largely replaced interfaces such as serial
ports and parallel ports. USB connectors have replaced other types of battery
chargers of portable devices with themselves.
Advantages of USB –
The Universal Serial Bus was designed to simplify and improve the interface between
personal computers and peripheral devices when compared with previously existing
standard or ad-hoc proprietary interfaces.
1. The USB interface is self-configuring. This means that the user need not adjust
settings on the device and interface for speed or data format, or configure
interrupts, input/output addresses, or direct memory access channels.
2. USB connectors are standardized at the host, so any peripheral can use any
available receptacle. USB takes full advantage of the additional processing power
that can be economically put into peripheral devices so that they can manage
themselves. USB devices mostly do not have user-adjustable interface settings.
Join Telegram:- @engineeringnotes_mu
3. The USB interface is hot pluggable or plug and plays, meaning devices can be
exchanged without rebooting the host computer. Small devices can be powered
directly from the USB interface thus removing extra power supply cables.
4. The USB interface defines protocols for improving reliability over previous
interfaces and recovery from common errors.
5. Installation of a device relying on the USB standard minimal operator action is
required.
Disadvantages of USB –
1. USB cables are limited in length.
2. USB has a strict “tree” topology and “master-slave” protocol for addressing
peripheral devices. Peripheral devices cannot interact with one another except via
the host, and two hosts cannot communicate over their USB ports directly.
3. Some very high-speed peripheral devices require sustained speeds not available in
the USB standard.
4. For a product developer, the use of USB requires the implementation of a complex
protocol and implies an intelligent controller in the peripheral device.
5. Use of the USB logos on the product requires annual fees and membership in the
organization.
Bus Contention:
Bus contention, in computer design, is an undesirable state of the bus in which more
than one device on the bus attempts to place values on the bus at the same time. Most
bus architectures require their devices follow an arbitration protocol carefully designed
to make the likelihood of contention negligible.
BUS Arbitration
Bus Arbitration refers to the process by which the current bus master accesses and
then leaves the control of the bus and passes it to another bus requesting processor
unit. The controller that has access to a bus at an instance is known as a Bus master.
Join Telegram:- @engineeringnotes_mu
A conflict may arise if the number of DMA controllers or other controllers or processors
try to access the common bus at the same time, but access can be given to only one of
those. Only one processor or controller can be Bus master at the same point in time. To
resolve these conflicts, the Bus Arbitration procedure is implemented to coordinate the
activities of all devices requesting memory transfers. The selection of the bus master
must take into account the needs of various devices by establishing a priority system for
gaining access to the bus. The Bus Arbiter decides who would become the current bus
master.
Advantages –
Simplicity and Scalability.
The user can add more devices anywhere along the chain, up to a certain
maximum value.
Disadvantages –
The value of priority assigned to a device depends on the position of the
master bus.
Propagation delay arises in this method.
If one device fails then the entire system will stop working.
In this, the controller is used to generate the address for the master (unique
priority), the number of address lines required depends on the number of masters
connected in the system. The controller generates a sequence of master
addresses. When the requesting master recognizes its address, it activates the
busy line and begins to use the bus.
Advantages –
This method does not favor any particular device and processor.
The method is also quite simple.
If one device fails then the entire system will not stop working.
Disadvantages –
Adding bus masters is difficult as increases the number of address lines of the
circuit.
(iii) Fixed priority or Independent Request method –
In this, each master has a separate pair of bus request and bus grant lines and
each pair has a priority assigned to it.
Join Telegram:- @engineeringnotes_mu
The built-in priority decoder within the controller selects the highest priority
request and asserts the corresponding bus grant signal.
Advantages –
This method generates a fast response.
Disadvantages –
Hardware cost is high as a large no. of control lines is required.
Y
X
21
37
Paper / Subject Code: 50924 / Digital Logic & Computer Architecture
FA
FA
21
21
X2
7Y
21
7Y
21
X
Join Telegram:- @engineeringnotes_mu
FA
FA
21
23
21
23
7Y
AX
21
7Y
AX
21
1
3
21
3
1F
F
2
X2
7Y
X
21
7Y
12
FA
1
3
3
Y2
2
2
X2
1
7Y
X
1
2
37
12
A
7
FA
21
(Time: 3 hours) (Total Marks: 80)
3
F
X2
Y2
X2
X2
Y
21
21
7
FA
37
A
FA
1
3
1
N.B. 1. Question No. 1 is compulsory
F
X2
2
X2
21
7Y
21
2
7
2. Attempt any three questions from remaining five questions
FA
A
21
1
3
21
3
2
F
2
X2
7Y
3. Assume suitable data if necessary and justify the assumptions
21
Y
X
7Y
2
7
2
FA
A
1
23
1
3
21
4. Figures to the right indicate full marks
3
2
1F
2
X2
7Y
AX
21
7Y
AX
7Y
2
A
1
23
1
3
3
1F
1F
F
2
Q1 a Draw the Detailed Von- Neumann architecture and explain in brief 05
X2
7Y
X
7Y
AX
21
12
12
A
FA
23
21
3
Y2
1F
b Explain IEEE-754 Floating point Representation 05
2
1
Y
X
Y
AX
21
12
37
12
7
A
FA
Explain the difference between Encoder and decoder
23
c 05
21
3
Y2
F
Q1
X2
Y2
1F
X2
1
7Y
21
2
d Differentiate between Hardwired control unit and Micro programmed control unit 05
7
12
FA
37
A
A
1
3
21
3
2
F
X2
F
2
X2
21
7Y
21
Y
AX
7Y
12
A
37
21
FA
1
3
Q2 a List out the basic and universal logic gates with the symbol, truth table, output 05
23
F
1F
2
2
2
7Y
7Y
AX
Y
AX
21
AX
expression
2
7
21
23
21
3
1
3
F
1F
2
What do you mean by BCD? Perform 792 + 128 using BCD addition
Y2
b 05
1F
2
7Y
X
7Y
X
AX
2
12
FA
12
A
7
21
23
23
F
Y2
1F
X2
Y2
21
Y
X
AX
2
7
12
FA
37
A
21
37
1
3
F
X2
Y2
1F
X2
7Y
X2
21
12
FA
37
FA
21
3
FA
1
2
X2
Y2
2
7Y
21
AX
21
2
FA
7
FA
37
b List & explain the characteristics of memory 05
21
23
1
3
21
2
F
2
2
21
7Y
Draw the Flowchart for the Booth’s Algorithm for signed integer multiplication and 10
AX
21
7Y
AX
7Y
c
AX
2
21
21
23
1
3
23
1F
Y2
1F
2
7Y
7Y
AX
AX
AX
12
2
7
23
21
3
1
23
Y2
1F
1F
X2
Y2
1F
AX
AX
12
37
12
Q4 a List the various methods to design the Hardwired control unit and explain any one 05
7
12
FA
37
3
1F
Y2
X2
1F
X2
Y2
X2
21
Y
12
12
FA
37
FA
37
FA
21
Y2
X2
2
2
X2
21
7Y
21
21
c 10
37
FA
7
FA
21
FA
1
23
21
3
X2
2
7Y
21
7Y
AX
21
Y
AX
21
FA
1
23
21
3
1F
1F
2
21
7Y
AX
7Y
AX
7Y
AX
12
12
23
1F
Y2
1F
Y2
1F
X2
AX
AX
12
12
37
Consider a 2-way set associative mapped cache of size 16 KB with block size 256
12
c 10
37
A
Y2
1F
Y2
1F
X2
Y2
1F
X2
12
37
12
FA
37
A
Y2
F
X2
Y2
X2
21
21
37
FA
37
FA
21
21
X2
X2
X2
7Y
21
7Y
21
FA
FA
FA
21
23
21
3
7Y
AX
21
7Y
AX
21
21
21
23
21
b 05
1F
1F
2
7Y
7Y
AX
7Y
AX
12
12
23
Y2
1F
Y2
1F
AX
AX
12
37
12
37
Y2
1F
X2
Y2
1F
X2
___________________________
12
37
12
FA
37
FA
Y2
X2
Y2
X2
21
21
37
FA
37
FA
21
X2
X2
21
7Y
21
FA
FA
21
21
23
7Y
21
7Y
57566 Page 1 of 1
AX
21
21
23
21
23
1F
7Y
AX
7Y
AX
12
23
23
Y2
1F
AX
AX
X237Y2121FAX237Y2121FAX237Y2121FAX237Y2121FA
12
37
Join Telegram:- @engineeringnotes_mu
🎯 HERE YOU GET ALL (MUMBAI UNIVERSITY ) ENGINEERING NOTES 🎯
SECOND YEAR ENGINEERING NOTES (MU) 📚
😊 😊
JOIN TELEGRAM
🎗️ 🎗️
KEEP SHARE THIS LINKS
👇👇👇👇👇👇👇👇👇👇👇👇
JOIN US TELEGRAM ALL LINKS FOR NOTES
⭐ 👉
1.CLICK TO JOIN CHANNEL @engineeringnotes_mu
⭐ 👉
2.CLICK TO JOIN GROUP @engineering_notes_mu
1. Data Hazards:
o Read After Write (RAW): Occurs when an instruction
depends on the result of a previous instruction that has not yet
written its result to the register file. This hazard can stall the
pipeline until the dependent instruction's result is available.
o Write After Read (WAR): Occurs when an instruction writes
to a register that a later instruction is reading from. This can
lead to incorrect results if not handled properly.
2. Control Hazards:
o Branch Hazards: Occur when there is a conditional branch
instruction in the pipeline, and the branch target is not yet
known. The pipeline needs to stall until the branch outcome is
resolved.
3. Structural Hazards:
o Resource Conflict: Occurs when two or more instructions
need access to the same hardware resource at the same time.
For example, if two instructions require access to the same
functional unit in the Execute stage simultaneously, a
structural hazard occurs.
4. Pipeline Flush:
• Volatility:
• Capacity:
• Speed:
• Access Method:
• Cost:
• Error Handling:
1. Slower Execution:
o Microinstructions are executed sequentially, which can
introduce additional overhead and slow down the CPU's
performance compared to hardwired control units.
o Each instruction requires multiple microinstructions to be
executed, leading to increased latency.
Advantages
Modularity:
Flexibility:
Disadvantages
• Complexity:
• Timing Constraints:
1. Microinstruction:
o A microinstruction contains control signals that control the
operation of the CPU during a clock cycle.
o Control signals specify actions such as enabling registers,
selecting multiplexer inputs, and controlling the ALU (Arithmetic
Logic Unit).
2. Control Signals:
o Control signals determine the behavior of the CPU during the
current clock cycle.
o Examples of control signals include:
1. Fetch Microinstruction:
o The control unit retrieves the microinstruction from the
microcode memory based on the current address.
2. Execute Microinstruction:
o The control unit interprets the control signals within the
microinstruction and performs the corresponding actions,
such as setting control lines, accessing registers or memory,
and activating the ALU.
3. Update Address:
o The control unit determines the address of the next
microinstruction based on the current microinstruction's next
address field.
o Address generation may involve simple incrementation,
branching based on conditions (e.g., branch if zero), or
jumping to specific addresses (e.g., subroutine call).
4. Repeat Process:
o The process repeats for each clock cycle, with the control unit
fetching, executing, and updating the address of the next
microinstruction.
1. Memory Array:
o The memory array consists of rows and columns of DRAM
cells. Each cell contains a capacitor to store data.
2. Control Logic:
o The control logic generates signals to read from or write to
specific rows and columns within the memory array.
3. Row Decoder:
o The row decoder selects a specific row in the memory array
based on the memory address provided by the control logic.
4. Sense Amplifiers:
o The sense amplifiers detect and amplify the tiny voltage
signals from the selected row of memory cells to distinguish
between stored 0s and 1s.
Pipeline hazards are situations that arise in pipelined processors that can
stall or disrupt the smooth flow of instructions through the pipeline,
leading to reduced performance or incorrect results. There are several
types of pipeline hazards:
Structural Hazards:
Data Hazards:
Control Hazards:
1. Direct Mapping:
o In direct mapping, each memory block in the main memory is
mapped to a specific cache line in the cache memory.
o A portion of the logical address (e.g., the middle bits) is used
to index into the cache.
Segmentation:
Paging:
• Paging divides the logical address space and physical memory into
fixed-size pages.
• The memory management unit (MMU) translates logical addresses
to physical addresses using a page table, which maps each page
MESI Protocol:
MOESI Protocol:
MESIF Protocol:
1. Invalidation-Based Coherence:
o In invalidation-based coherence, when one cache updates a
memory location, it sends an invalidation message to all other
caches holding copies of the same memory location.
Update-Based Coherence:
A full adder is a combinational logic circuit that adds three input bits (A, B, and Cin) and
produces two output bits (Sum and Cout). It can be implemented using two half adders and
additional logic gates.
Half Adder:
A half adder adds two input bits (A and B) and produces two output bits (Sum and Cout).
A B Sum Cout
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Full Adder:
A full adder adds three input bits (A, B, and Cin) and produces two output bits (Sum and
Cout).
Implementation:
1. Use the first half adder to add A and B, producing a partial sum (PS) and a partial carry (PC).
2. Use the second half adder to add PS and Cin, producing the final sum (Sum) and the final
carry out (Cout).
3. • HA1: First half adder (adds A and B)
4. • HA2: Second half adder (adds PS and Cin)
5. • OR: OR gate (combines PC and Cout)
The CPU is the core component responsible for executing instructions and
performing data processing operations.
3. Input/Output (I/O):
• Control Unit:
o Fetches instructions from memory.
o Decodes instructions to determine their operations.
o Generates control signals to coordinate the activities of other
units.
o Manages the flow of data and instructions between different
units.
• ALU:
o Performs arithmetic operations (e.g., addition, subtraction)
and logical operations (e.g., AND, OR, NOT) on data operands.
o Executes instructions that involve mathematical calculations
or logical comparisons.
• Registers:
o Program Counter (PC): Holds the memory address of the next
instruction to be fetched.
o Instruction Register (IR): Holds the current instruction being
executed.
o General-Purpose Registers: Hold data operands and
intermediate results during computation.
o Accumulator: Stores results of arithmetic operations.
o Index Registers: Hold memory addresses or offsets for data
access.
o Stack Pointer: Points to the top of the stack used for
subroutine calls and local variables storage.
A master-slave J-K flip-flop with preset (PR) and clear (CLR) inputs can be
constructed using NAND gates. Here's the logic circuit diagram, truth
table, and logic symbol diagram:
• J and K are the data inputs.
• PR (preset) and CLR (clear) are the control inputs.
This circuit functions as a master-slave J-K flip-flop with preset (PR) and
clear (CLR) inputs. It stores a single bit of information and can be used in
sequential logic circuits for various applications like counters, shift
registers, and memory elements.
NOR Gate
A NOR gate is a combination of an OR gate followed by a NOT gate. It
outputs a 1 only when all its inputs are 0; otherwise, it outputs 0.
A B Z
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate
Circuit: Connect each input to a NAND gate and then connect the
outputs of these gates to the inputs of another NAND gate.
A B Output (A OR B)
0 0 0
1 0 1
0 1 1
1 1 1
A B OUTPUT(A XOR B)
0 0 0
0 1 1
1 0 1
1 1 0
40Oh
Sin
IMD
rucgon
s s+em?s
n le
o
Date:
MIS
Oh
s lYl
Date:
) МЂ—Бћћ Ми Н? (е
Рац
то с soy ab(e +0
M(.l14G с4?оул
Date:
-L
(060C
Les
01 a ucte
Les
CO nhol M s
Date.'
SOXAM
SONAM n s
4-0
Coch Us
has
CO n
10
Dec_2022 May_2023 Dec_2023
MUMBAI UNIVERSITY
SEMESTER 3
Digital Logic Design And Analysis
DECEMBER 2017-CBCS
Remainder
8 1762 2
220 4 ∴ (1762)10 = (3342)8
27 3
3 3
Fractional part :
0. 46
8
3 68 ∴ (0.42)10 = (0.353)8
8
5 44 ∴ (1762.46)10 = (3342.353)8
8
3 52
2 1762 0
881 1 ∴ (1762)10 = (11011100010)8
440 0
220 0
110 0
55 1
27 1
13 1
6 0
3 1
1 1
Fractional part :
0. 46
2
0 92 ∴ (0.42)10 = (0.011)2
2
1 84 ∴ (1762.46)10 = (11011100010.011)2
2
1 68
Remainder
16 1762 2
110 E ∴ (1762)10 = (6E2)16
6 6
Fractional part :
0. 46
16
7 36 ∴ (0.42)10 = (0.75C)2
16
5 76 ∴ (1762.46)10 = (6E2.75C)2
16
C 16
X=(1010001)
(g) Implement the following Boolean equation using NAND gates only.
Y= AB+CDE+F [2]
Ans : In this y can be implemented using 3 input nand and 2 input nand
gates.
(h) Explain the term prime implicant. [2]
Ans :
i) A group of related 1's (implicant) on a Karnaugh map which is not subsumed by
any other implicant in the same map. Equivalently (in terms of Boolean algebra), a
product term which is a "minimal" implicant in the sense that removing any of its
literals will yield a product term which is not an implicant (on a Karnaugh map it
would appear "maximal").
ii) A group of related 0's (implicant) on a Karnaugh map which is not subsumed by
any other implicant (of 0's) in the same map.
(ii) A ripple carry adder is a logic circuit in which the carry-out of each full adder is
the carry in of the succeeding next most significant full adder. It is called a ripple carry
adder because each carry bit gets rippled into the next  stage.
(iii)In a ripple carry adder the sum and carry out bits of any half adder stage is not
valid until the carry in of that stage occurs.
(iv)Propagation delays inside the logic circuitry is the reason behind this. Propagation
delay is time elapsed between the application of an input and occurance of the
corresponding output.
(v)Consider a NOT gate, When the input is “0” the output will be “1” and vice versa.
The time taken for the NOT gate’s output to become “0” after the application of logic
“1” to the NOT gate’s input is the propagation delay here.
(v)Similarly the carry propagation delay is the time elapsed between the application of
the carry in signal and the occurance of the carry out (Cout) signal.
(vi) Sum out S0 and carry out Cout of the Full Adder 1 is valid only after the
propagation delay of Full Adder 1.
(vii) In the same way, Sum out S3 of the Full Adder 4 is valid only after the joint
propagation delays of Full Adder 1 to Full Adder 4. In simple words, the final
result of the ripple carry adder is valid only after the joint propogation delays of
all full adder circuits inside it.
A B C D
1 0 0 0 1
2 0 0 1 0
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
Step 2:
Create the following table in which the binary number with equal number of
1's are grouped together. For e.g. the first group contains binary numbers with
only one number of 1's, second group contains binary numbers with two 1's
and so on.
Step 3: In the next step compare every element of group 1 with elements in
group 2, elements of group 2 with 3, etc. In general compare elements of nth
group with elements of n+1th group. If only 1 element is changing in the
comparison the mark it with an underscore. Put a tick mark against both the
elements if the elements are present in the comparison. For e.g. in m1 and m5
the A, C, D bits are same but only B bit changes, so an underscore is put
against it.
Step 4: In this step again match the values of nth group with n+1th group and
mark tick against the ones that gets matched, followed by underscore to the
single bits that change. Since m1 m5, d2 m6 are not getting matched with any
other no tick marks is put against them.
Step 5: Now make the last table which contains the prime implicant and the
min terms involved (Prime implicants are the ones that do not get matched).
Write them in their alphabet form with 0 bit represented as bars. In this step
write all the numbers which were given in the question (not the don't care
ones). Put a cross below the numbers which contain the minterms.
Prime Minterms 1 5 6 12 13 14
Implicant Involved
BC 4, 5, 12, 13 ˟ ˟ ˟
BD 4, 6, 12, 14 ˟ ˟ ˟
ACD 1, 5 ˟ ˟
ACD 2, 6 ˟
If the column of the numbers contain only one cross then the prime implicant
belonging to the single cross belonging row is considered. In this case the
columns of 1, 13 and 14 contain only 1 crosses so the row belonging to them is
considered which are BC, BD, ACD. These are the reduced answer.
Y = BC + BD + ACD
∴ F(A,B,C,D) = BC + BD + ACD
A B C SUM CARRY
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
We will require two 8:1 multiplexer to implement a full adder. One for sum
and one for carry.
In 8:1 MUX we have 3 selection lines, assigning them A, B, C.For sum :
For carry :
(b) Implement the following functions using demultiplexer.
F1(A,B,C)=∑𝐦(0,3,7) F2(A,B,C)=∑𝐦(1,2,5) [5]
Ans :
(1) F1 (A, B, C) = 𝛴m(0, 3, 7)
Number of variables = 3
Number of select lines = 3
Number of lines = 23 = 8
F(A,B,C,D)=∏m(0,1,2,8,9,12,13,14)
K-map is given by
Circuit Diagram :
Q.4(a) Compare TTL and CMOS logic withn respect to fan in,fan out
Propogation delay,power consumption,noise margin,current and
Voltage parametes. [5]
Ans :
Parameter TTL CMOS
Propagation Delay 1 to 200nsec 1.5 to 33nsec
Power consumption Relatively High Depends on Vcc
Noise Margin 0.3-0.5 0.3Vcc
Current High (0.2-2mA) Low (1uA)
Voltage 5V 3-18V
Fan in High fan in Low fan in
Fan out Approx. 10 >50
Transistor used BJT FET
Type Current controlled Voltage controlled
Current devices current device
(b) Draw the circuit of SR flip flop using two NOR gates and write the
Architecture body for the same using structural modelling. [5]
Ans :
SR FLIP FLOP
Architectural Body :
begin
PROCESS(CLOCK)
begin
tmp:=tmp;
tmp:='Z';
tmp:='0';
else
tmp:='1';
end if;
end if;
Q <= tmp;
i) BCD adder adds two BCD digits and produces output as a BCD digit. A
BCD or Binary Coded Decimal digit cannot be greater than 9.
ii)The two BCD digits are to be added using the rules of binary addition. If
sum is less than or equal to 9 and carry is 0, then no correction is needed. The
sum is correct and in true BCD form.
iii)But if sum is greater than 9 or carry =1, the result is wrong and correction
must be done.
S3 S2 S1 S0 Y
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
vi) The Boolean expression is, Y=S3S2+S3S1Y=S3S2+S3S1
vii)The BCD adder is shown below. The output of the combinational circuit
should be 1 if Cout of adder-1 is high. Therefore Y is ORed with Cout of adder
1.
viii)The output of combinational circuit is connected to B1B2 inputs of adder-2
and B3=B1+0B3=B1+0 as they are connected to ground permanently. This
makes B3B2B1B0B3B2B1B0 = 0110 if Y' = 1.
Qn 𝑄𝑛+1 J K
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
3.Conversion Table:
S R 𝑄𝑛 𝑄𝑛+1 J K
0 0 0 0 0 X
0 1 1 1 X 0
0 0 0 0 0 X
0 1 1 0 X 1
1 0 0 1 1 X
1 1 1 1 X 0
1 0 - - X X
1 1 - - X X
4. Logical expressions for the inputs :
Simplify the logical expressions for the inputs of the given flip-flop (J and K) in terms
of the inputs of the desired flip-flop (S and R) and the flip-flop's present-state, Qn.This
can be done by following any logical simplification technique like that of the
K-map.
5. Circuit Diagram :
S J 𝑄𝑛
CLK JK FF
R K 𝑄𝑛+1
(B) JK TO D FF :
D Q 𝑄̅
0 0 0
0 1 0
1 0 1
1 1 1
2.Excitation Table of JK FF:
Qn 𝑄𝑛+1 J K
0 0 0 X
0 1 1 X
1 0 X 1
1 1 X 0
3.Conversion Table :
D 𝑄𝑛 𝑄𝑛+1 J K
0 0 0 0 X
0 1 1 0 1
1 0 0 1 X
1 1 0 1 0
4.Use a K-map to obtain the logical expressions for the inputs J and K
in terms of D and Qn.
5. Circuit Diagram:
D J 𝑄𝑛
CLK JK FF
K
𝑄𝑛+1
(b) Design 3 bit synchronous counter using T flip flops. [10]
(ii)The only way we can build such a counter circuit from T flip-flops is to
connect all the clock inputs together, so that each and every flip-flop receives the
exact same clock pulse at the exact same time.
(iii) For an up counter that means it will count from value 0 to 7 for interval
difference of 1.
(viii)The output of first T flip-flop toggles for every negative edge of clock
signal.
(ix)The output of second T flip-flop toggles for every negative edge of clock
signal if Q0Q0 is 1.
(x)The output of third T flip-flop toggles for every negative edge of clock signal
if both Q0Q0 & Q1Q1 are 1.
(Here we can write Q3Q2Q1=Q2Q1Q0).
Q.6 Write short note on (any four) [20]
Ans :
i) The state table representation of a sequential circuit consists of three
sections labeled present state, next state and output.
iii) The next state shows the states of flip-flops after the clock pulse, and
the output section lists the value of the output variables during the
present state.
iv) The 4-bit wide ALU can perform all the traditional add / subtract /
decrement operations with or without carry, as well as AND /
NAND, OR / NOR, XOR, and shift.
ii) These circuits when suitably manipulated can be made to count till
an intermediate level also. This means that instead of counting till 7, we
can terminate the process by resetting the counter just at, say, 5. Such
counters are then known as mod-N counters.
D1 Q1 D0 Q0
CLK
Sequence Generator
Truth Table :
CLK 𝑄3 𝑄2 𝑄1 𝑄0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
DLDA
(CBCGS MAY 2018)
(02)
Solution :-
NOR Gate:
A logic gate whose output logic is ‘1’ if and only if all of its inputs are logic ‘0’.
Entity declaration of NOR gate
Library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity nor_df is
Port (a: in STD_LOGIC;
b: in STD_LOGIC;
c: out STD_LOGIC);
end nor_df;
architecture Behavioral of nand_df
is
begin
c<=a nor b;
00100010
+ 01010110
01111000
(22)10 + (56)10 = 01111000
Q1] c) Convert decimal 57 into binary, base 7 and hexadecimal.
(02)
Solution :-
Decimal 57 to binary
Decimal 57 to base 7
Decimal 57 to hexadecimal
1 0 1 0 0 1 0
Therefore, hamming code for 1010 is given as 1010010.
(02)
Solution :-
Binary representation of 7 is 0111
1’s complement of 7 is 1000
2’s complement of 7 is 1’s complement + 1
1000
+ 1
1001
1010
+ 1001
10011
Discard carry 1
Therefore (10)10 - (7)10 = 0011 = (3)10.
(02)
Solution :-
Theorem 1:
Statement: The complement of the product of two or more variables is equal to the sum of the
components of the variables.
Logical expression: ̅̅̅̅̅ ̅+B
A. B = A ̅
NAND is equal to BUBBLED OR.
A B A.B ̅̅̅̅̅
A. B ̅
A ̅
B ̅+B
A ̅
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
From the above truth table we can see that ̅̅̅̅̅ ̅+B
A. B = A ̅ Hence proved.
Theorem 2 :-
Statement: The complement of the sum of two or more variables is equal to the product of the
complement of the variables
Logical expression: ̅̅̅̅̅̅̅̅
𝐴 + 𝐵 = 𝐴̅. 𝐵̅
NOR is equal to BUBBLED AND.
A B A+B ̅̅̅̅̅̅̅
A+B ̅
A ̅
B ̅. B
A ̅
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
(02)
Solution :-
Excess 3 code is 3 added to BCD.
BCD of 77 is 0111 0111 and 0f 3 is 0011
01110111
+ 00110011
10101010
Excess 3 code of 77 is 10101010
(02)
Solution :-
(34)8 + (62)8
34
+ 62
116
In the above sum 6 + 3 is greater than 7 hence can’t be represented as octal therefore we need to
divide it with 8
(02)
Solution :-
To find 8’s complement we first need to find 7’s complement and then add 1 to it.
7’s complement of 37 is obtain by subtracting 37 from 77
i) 77
+ 37
40 7’s complement
+ 1
41 8’s complement
ii) 777
+ 301
+ 1
(02)
Solution :-
ASCII was developed by the American National Standards Institute (ANSI). Pronounced ask-ee, ASCII
is the acronym for the American Standard Code for Information Interchange.
It is a code for representing 128 English characters as numbers.
Technically, ASCII is 7-bit representing only 128 characters (0-127). The range 0-31 are control
characters, with 32-127 representing alphabetical characters from A to Z, numerals from 0 to 9 and
punctuation marks (though not in that order).
For example, the ASCII code for uppercase M is 77.
Most computers use ASCII codes to represent text, which makes it possible to transfer data from one
computer to another.
Text files stored in ASCII format are sometimes called ASCII files. Text editors and word
processors are usually capable of storing data in ASCII format, although ASCII format is not always
the default storage format.
Q2] a) Simplify the following equation using K map to obtain SOP equation and realize the
minimum equation using only NAND gates.
(10)
Solution :-
(10)
Solution :-
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
In full adder there are 3 input A, B and Cin and they are added and generates two output S and Cout.
S is the sum of A, B and Cin and Cout is the carry generated by adding 3 input’s.
An 8:1 multiplexer consists of eight data inputs I0 to I7, three input select lines A, B and C and a single
output line Y. Depending on the select lines combinations, multiplexer decodes the inputs.
Since the number of input data bits given to the MUX are eight therefore 3 bits (23=8) are needed to
select one of the eight data bits. That is there is 3 select lines in 8:1 MUX.
Since in full adder there are 2 output, we need two 8:1 multiplexer. Output of 1st multiplexer is sum
of adder and output of 2nd multiplexer is carry generated of full adder.
Fig. Full Adder using 8:1 MUX
As we can see in the above diagram there are 3 select lines A, B and C. there are 7 input I0 to I7.
The input is connected to 0 or 1 depending upon the value given in truth table.
The select lines of both multiplexer is connected to same input.
(10)
Solution :-
Table 1
Group Minterm Binary Representation
A B C D
0 M1 0 0 0 1
M2 0 0 1 0
M4* 0 1 0 0
1 m3 0 0 1 1
m5 0 1 0 1
m6 0 1 1 0
m10 1 0 1 0
2 m13 1 1 0 1
m14 1 1 1 0
m7* 0 1 1 1
Table 2
Table 3
Group Minterm Binary Representation
A B C D
0 m1-m3-m5-m7 0 _ _ 1
M1-m5-m3-m7 0 _ _ 1
M1-m5-m10-m14 _ _ _ _
M2-m3-m6-m7 0 _ 1 _
M2-m6-m3-m7 0 _ 1 _
M2-m6-m10-m14 _ _ 1 0
M2-m10-m5=m13 _ _ _ _
M2-m10-m6-m14 _ _ 1 0
M4-m5-m6-m7 0 1 _ _
M4-m6-m5-m7 0 1 _ _
PI Decimal of PI 1 2 3 5 6 10 13 14 4 7
𝐴̅𝐷 M1 m3 m5 m7 ⊗ X X X
𝐴̅𝐶 M2 m3 m6 m7 X X X X
̅
𝐶𝐷 M2-m6-m10-m14 X X ⊗ ⊗
𝐴̅𝐵 M4-m5-m6=m7 X X ⊗ X
Y=𝐀 ̅̅̅̅ + 𝐀
̅ 𝐃 + 𝐂𝐃 ̅B
(10)
Solution:-
The race around condition occurs in JK flipflop when both the inputs are high that is J=K=1 normally
in level triggered JK flipflop.
In master slave flipflop master and slave are inverted clock so that only one will be active at a time.
During the high of the clock, output will be toggled and will remain at the output of master but could
not be followed by slave as it is disabled. So, output of slave remains same as earlier and toggled
output remains at master. When clock is low master is deactivated and slave is enabled which only
follows the output of master. So at the end of one complete clock we just have one toggled output
and race around condition is avoided.
Q4] a) Design 3 bit asynchronous counter and draw the timing diagram.
(10)
Solution :-
A ripple counter is an asynchronous counter where only the first flip-flop is clocked by an external
clock. All subsequent (next occurring) flip-flops are clocked by the output of the preceding flip-flop.
In asynchronous counter, a clock pulse drives FF0. Output of FF0 drives FF1 which then drives the
FF2 flip flop. All J and K inputs are connected to Logic 1. Therefore, each flip flop will toggle with
negative transition at its clock input.
The output of the flip flops is a binary number equivalent to the number of clock pulses received.
The output conditions are as shown in the truth table.
Counter Q2 Q1 Qo
State
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
On the negative edge of eighth pulse, counter is reset. The counter acts as a frequency divider. FF0
divides clock frequency by 2, FF1 divides clock frequency by 4, FF2 divides clock frequency by 8. If n
flip flops are cascaded, we get 2n output conditions. The largest binary number counted by n
cascaded flip flops has a decimal equivalent of 2n −1. MOD-8 counter has count of the largest binary
number 111 which has decimal equivalent of 23−1=7.
(10)
Solution :-
JK to SR
a) Excitation Table
Input’s Present State Next State Flip Flop Input
S R Qn Qn+1 J K
0 0 0 0 0 X
0 0 1 1 X 0
0 1 0 0 X X
0 1 1 0 X 1
1 0 0 1 1 X
1 0 1 1 X 0
1 1 0 X X X
1 1 1 X X X
b) K- map simplification
For J
For K
c) Logic diagram
JK to D
a) Excitation Table
D Qn Qn+1 J K
0 0 0 0 X
0 1 0 X 1
1 0 1 1 X
1 1 1 X 0
b) K-map simplification
For J
J=D
For K
c) Logic diagram
(10)
Solution :-
(10)
Solution:-
VHDL stands for very high-speed integrated circuit hardware description language. This language was
first introduced in 1981 for the department of Defense (DoD) under the VHSIC program.
Features of VHDL are as follows:
1) Designs are organized hierarchically.
2) Each design element has:
i) A well-defined interface.
ii) A precise behavioral specification using either algorithmic description or hardware
structural description.
3) Models concurrency, timing, and clocking:
i) Handles asynchronous and synchronous circuits
ii) Designs can be simulated.
4) Language is not case sensitive.
5) A formal language for specifying the behavior and structure digital circuit.
Modeling styles: Modeling Style means, that how we Design our Digital IC's in Electronics. With the
help of modeling style we describe the Design of our Electronics.
Normally we use Three type of Modeling Style in VHDL -
• Data Flow Modeling Style.
• Behavior Modeling Style.
• Structural Modeling Style.
Data Flow Modeling Style – Dataflow system describes a system in terms of how data flows through
the system. Data dependencies in the description match those in atypical hardware implementation.
A dataflow description directly implies a corresponding gate level implementation.
Dataflow descriptions consist of one or more concurrent signal assignment situation
Behavior Modeling Style – A behavioral description describes a system’s behavior or function in an
algorithmic fashion.
Behavioral style is the most abstract style. The description is abstract in the sense that it does not
directly imply a particular gate-level implementation.
Behavioral style consists of one or more process statements. Each process statement is a single
concurrent statement that itself contains one or more sequential statements.
Sequential statements are executed sequentially statements by a simulator, the same as the execution
of sequential statements in a conventional programming language.
Structural Modeling Style – In structural style of modelling, an entity is described as a set of
interconnected components.
The top-level design entity’s architecture describes the interconnection of lower level design entities.
Each lower level entity can, in turn, be described as an interconnection of design entities at the next-
lower level, and so on.
Structural style is most useful and efficient when a complex system is described as an interconnection
of moderately complex design entities. This approach allows each design entity to be independently
designed and verified before being used in the higher-level description.
(05)
Solution :-
Moore Machines: Moore machines are finite state machines with output value and
its output depends only on present state. It can be defined as (Q, q0, ∑, O, δ, λ) where:
• Q is finite set of states.
• q0 is the initial state.
• ∑ is the input alphabet.
• O is the output alphabet.
• δ is transition function which maps Q×∑ → Q.
• λ is the output function which maps Q → O.
Figure 1
In the moore machine shown in Figure 1, the output is represented with each input state separated
by /. The length of output for a moore machine is greater than input by 1.
• Input: 11
• Transition: δ (q0,11)=> δ(q2,1)=>q2
• Output: 000 (0 for q0, 0 for q2 and again 0 for q2)
Mealy Machines: Mealy machines are also finite state machines with output value and its output
depends on present state and current input symbol. It can be defined as (Q, q0, ∑, O, δ, λ’) where:
• Q is finite set of states.
• q0 is the initial state.
• ∑ is the input alphabet.
• O is the output alphabet.
• δ is transition function which maps Q×∑ → Q.
• ‘λ’ is the output function which maps Q×∑→ O.
Figure 2
In the mealy machine shown in Figure 1, the output is represented with each input symbol for each
state separated by /. The length of output for a mealy machine is equal to the length of input.
• Input:11
• Transition: δ (q0,11)=> δ(q2,1)=>q2
• Output: 00 (q0 to q2 transition has Output 0 and q2 to q2 transition also has Output 0)
(05)
Solution :-
the sequence generators are nothing but a set of digital circuits which are designed to result in a
specific bit sequence at their output. There are several ways in which these circuits can be designed
including those which are based on multiplexers and flip-flops.
A circuit which generates a prescribed sequence of bits, in synchronization with a clock, is referred
to as a sequence generator such generator can be used as:
1] counters.
4] Code generator.
The basic structure of a sequence generator is shown in diagram below:
The output Y of the next state decoder is function of QN-2, QN-1 …….. Q1, Q0. This system is similar
to a ring counter or twisted ring counter which are special case of sequence generator, the design of
the decoder will be clear.
(05)
Solution:-
A Universal shift register is a register which has both the right shift and left shift with parallel load
capabilities. Universal shift registers are used as memory elements in computers. A Unidirectional
shift register is capable of shifting in only one direction. A bidirectional shift register is capable of
shifting in both the directions. The Universal shift register is a combination design
of bidirectional shift register and a unidirectional shift register with parallel load provision.
n-bit universal shift register –
A n-bit universal shift register consists of n flip-flops and n 4×1 multiplexers. All the n multiplexers
share the same select lines(S1 and S0)to select the mode in which the shift register operates. The
select inputs select the suitable input for the flip-flops.
The working of the Universal shift register depends on the inputs given to the select lines.
The register operations performed for the various inputs of select lines are as follows:
S1 S0 REGISTER OPERATION
0 0 No changes
0 1 Shift Right
1 0 Shift Left
1 1 Parallel Load
(05)
Solution :-
The priority encoders output corresponds to the currently active input which has the highest priority.
So, when an input with a higher priority is present, all other inputs with a lower priority will be ignored.
A priority encoder provides n bits of binary coded output representing the position of the highest
order active input of 2ninputs. If two or more inputs are high at the same time, the input having the
highest priority will take precedence.
A 4-to-2 priority encoder takes 4 input bits and produces 2 output bits as shown in figure 6.4. In this
truth table, for all the non-explicitly defined input combinations (i.e. inputs containing 2, 3, or 4 high
bits) the lower priority bits are shown as don't cares (X). Similarly, when the inputs are 0000, the
outputs are not valid and therefore they are XX.
I3 I2 I1 I0 Y1 Y0
0 0 0 0 X X
0 0 0 1 0 0
0 0 1 X 0 1
0 1 X X 1 0
0 1 X X 1 0
1 X X X 1 1
From this truth table, we use the Karnaugh Map to minimize the logic to the following Boolean
expressions:
Y1 = I2 + I3
Y0 = I3 + I2 X I1
(05)
Solution :-
In ripple carry adders, for each adder block, the two bits that are to be added are available instantly.
However, each adder block waits for the carry to arrive from its previous block. So, it is not possible
to generate the sum and carry of any block until the input carry is known. This disadvantage is
overcomed in carry look ahead adder.
Pi = Ai ⊕ Bi
Gi = Ai x Bi
DIGITAL LOGIC DESIGN AND ANALYSIS (DLDA)
NOVEMBER--2018
Q1 (a) Convert decimal number 576.24 into binary, base-9, octal, hexadecimal
system. (04)
Solution:
(i)Conversion to Binary
2 576
2 288 0
2 144 0
2 72 0
2 36 0
2 18 0
2 9 0
2 4 1
2 2 0
2 1 0
0 1
The binary equivalent of 576 is 1001000000.
0.24 x 2 = 0.48 ~ 0
0.48 x 2 = 0.96 ~ 0
0.96 x 2 = 1.92 ~ 1-
0.92 x 2 = 1.84 ~ 1
0.84 x 2 = 1.68 ~ 1
(576.24) = (1001000000.00111)
10 2
(ii)Conversion to Base-9
9 576
9 64 0
9 7 1
0 7
1
The base-9 equivalent of 576 is (710).
0.24 x 9 = 2.16 ~ 2
0.16 x 9 = 1.44 ~ 1
0.44 x 9 = 3.96 ~ 3
0.96 x 9 = 8.64 ~ 8
(576.24) =(710.2138)
10 9
(iii)Conversion to Octal
8 576
8 72 0
8 9 0
8 1 1
0 1
The octal equivalent of 576 is (1100).
0.24 x 8 = 1.92 ~ 1
0.92 x 8 = 7.36 ~ 7
0.36 x 8 = 2.88 ~ 2
0.88 x 8 = 7.04 ~ 7
(576.24) = (1100.1727)
10 8
(iv)Conversion to Hexadecimal
16 576
16 36 0
16 2 4
0 2
The Hexadecimal equivalent of 576 is (240).
0.24 x 16 = 3.84 ~ 3
0.84 x 16 = 13.44 ~ D
0.44 x 16 = 7.04 ~ 7
0.04 x 16 = 0.64 ~ 0
(576.24) = (240.3D70)
10 16
---------------------------------------------------------------------------------------------------------------------------
(b) Construct hamming code for 1010 using odd parity. (04)
Solution:
The given code is 1010 i.e. 4-bits.
∴ 3 Parity bits are required.
2
1 2 3 4 5 6 7
P1 P2 1 P3 0 1 0
1 2 3 4 5 6 7
0 1 1 0 0 1 0
(c)Convert (-89) to its equivalent sign magnitude, 1’s Complement and 2’s
10
Sign bit
1 1 0 1 1 0 0 1
MSB magnitude
(-89) = (11011001)
10 2
0 0 1 0 0 1 1 0
+ 1
___________________________________________________
0 0 1 0 0 1 1 1
--------------------------------------------------------------------------------------------------------------------------
Solution:
B C 5B 1
- A 2 B
__________________________________
3
1 9 A
Here, as 5 < B, so we borrow 16 from the previous value as the given values are in
Hexadecimal format. 16 is then added to 5 ,thus it becomes 21 and 21 is subtracted from B.
So, we get answer as A.
Since, we have borrowed from the previous value i.e C ,the value of C decreases by 1.So, it
becomes B.
---------------------------------------------------------------------------------------------------------------------------
Solution:
The two theorems suggested by De-Morgan and which are extremely useful in Boolean
algebra are stated as follows:
___ __ __
Theorem 1: AB = A + B
NAND = Bubbled OR:
This theorem states that the complement of a product is equal to the sum of individual
complements.
___ __ __ __ __
A B AB A B A + B
0 0 1 1 1 1
0 1 1 1 0 1
1 0 1 0 1 1
1 1 0 0 0 0
4
___ __ __
Thus we can see that AB = A + B .
Theorem 2 : A + B = A ・ B
NOR = Bubbled AND:
This theorem states that the complement of a sum is equal to the product of individual
complements.
______ __ __ __ __
A B A+B A B A ・ B
0 0 1 1 1 1
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 0
_____ __ __
Thus we can say that A + B = A ・ B .
5
_ _ _
Q.2(a)Given the logic expression A + B C + A B D + A B C D (10)
1. Express it in standard SOP form.
2. Draw K-map and simplify
3. Draw logic diagram using NOR gates only.
Solution:
_ _ _ __ _ _ _ _ __ _ _ _ _
+A B C D + A B C D + A B C D + A B C D + A B C D + A B C D + A B C D
6
Q.2(b)Reduce using Quine McCluskey method and realize the operation using only
NAND gates. (10)
F(A, B, C, D)= π M(0, 2, 3, 6, 7, 8, 9, 12, 13)
Solution:
7
Group Minterm Binary representation
A B C D
1 1 0 0 0 1
4 0 1 0 0
2 5 0 1 0 1
10 1 0 1 0
3 11 1 0 1 1
14 1 1 1 0
4 15 1 1 1 1
1 1-5 0 - 0 1
4-5 0 1 0 -
2 10-11 1 0 1 -
10-14 1 - 1 0
3 11-15 1 - 1 1
14-15 1 1 1 -
1 10-11-14- 1 - 1 -
15
10-14-11- 1 - 1 -
15
8
Step 4: Collecting all Prime Implicants
_ _ _ _
From Step 2, the prime implicants are A C D and A B C .
From Step 3, we get the prime implicants as A C.
_ _ _ _
F(A, B, C, D)= A C D + A B C + A C
1 4 5 10 11 14 15
_ _
ACD 1,5 X X
_ _
ABC 4,5 X X
AC 10,11,14,15 X X
X X
_ _ _ _
∴ F(A, B, C, D)= A C D + A B C + A C
9
Q.3(a)Design a 4-bit binary to gray code converter. (10)
Solution:
The truth table showing binary inputs being converted to gray outputs is as follows:
K-map for g :
0 K-map for g :
1
__ __ __ __
∴ g = b1 b0 + b1 b0
0 ∴ g = b2 b3 + b2 b3
1
10
K-map for g : 2 K-map for g : 3
__ __
∴ g = b1 b2 + b1 b2
2 ∴ g = b3
3
The logic diagram of 4-bit Binary to Gray code converter is as shown below.
---------------------------------------------------------------------------------------------------------------------------
Q.3(b)Design a 4 bit BCD adder using IC 7483 and necessary gates. (10)
Solution:
1. A BCD adder adds two BCD digits and produces a BCD digit. BCD number cannot be
greater than 9.
2. The two given BCD numbers are to be added using the rules of binary addition.
3. If sum is less than or equal to 9 and carry=0 then correction is necessary. The sum is
correct and in the true BCD form.
4. But if sum is invalid BCD or carry=1, then the result is wrong and needs correction.
5. The wrong result can be corrected by adding six (0110) to it.
6. The 4 bit binary adder IC 7483 can be used to perform addition of BCD numbers.
11
7. In this, if the four-bit sum output is not a valid digit, or if a carry C3 is generated then
decimal 6 (0110 binary) is to be added to the sum to get the correct result.
8. Fig1 shows a 1-digit BCD adders can be cascaded to add numbers several digits long
by connecting the carry-out of a stage to the carry-in of the next stage.
9. The output of combinational circuit should be 1 if the sum produced by adder 1 is
greater than 9 i.e. 1001. The truth table is as follows:
I/P O/P
S3 S2 S1 S0 Y
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
Truth table for BCD numbers
Y=1 since the sum obtained is an invalid BCD number.
12
The BCD adder is shown below. The output of the combinational circuit should be 1 if
Cout of adder-1 is high. Therefore Y is 0 with Cout of adder 1.
The output of combinational circuit is connected to B B inputs of adder-2 and B = B +
1 2 3 1
combinational circuit is to be used as final output carry and the carry output of adder-
2 is to be ignored.
13
Hence output of adder-2 is same as that of adder-2
Case 2: Sum >9 and carry = 0
If S3S2S1S0 of adder -1 is greater than 9, then output Y’ of combinational circuits
becomes 1.
Therefore B B B B = 0 1 1 0 (of adder-2).
3 2 1 0
14
Q.4(a)Implement the following logic function using all 4 : 1 multiplexers with the select
inputs as ‘B’, ‘C’, ‘D’, ‘E’ only.
F(A, B, C, D, E) = Σ(0,1,2,3,6,8,9,10,13,15,17,20,24,30) (10)
Solution:
D 0 D 1 D 2 D 3 D 4 D 5 D 6 D 7 D 8 D 9 D 10 D 11 D 12 D 13 D 14 D 15
_
A 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
_ _ _ _ _ _ _ _
A 1 A A A 0 A 0 1 A A 0 0 A A A
15
Q.4(b)Convert a SR flip flop to JK flip flop. (10)
Solution:
16
Q.5(a)Design a mod-6 synchronous counter using T flip flop. (10)
Solution:
(i)State Diagram :
(ii)State Table :
0 0 0 0 0 1 0 0 1
0 0 1 0 1 0 0 1 1
0 1 0 0 1 1 0 0 1
0 1 1 1 0 0 1 1 1
1 0 0 1 0 1 0 1 1
1 0 1 0 0 0 1 0 1
1 1 0 0 0 0 1 1 0
1 1 1 0 0 0 1 1 1
17
T =QQ +QQ +QQ
C A B B C A C
__ __
TB = QAQC + QBQC + QCQA
__ __
T =Q +Q +Q
A C B A
(iv)Logic Diagram:
18
---------------------------------------------------------------------------------------------------------------------------
Solution:
A shift register which can shift the data in only one direction is called as a unidirectional shift
register. A shift register which can shift the data in both directions is called as bi-directional
shift register. Similarly, a shift register which can shift data in both directions i.e shift left or
right as well as load it parallelly, is called as a universal shift register.
The figure below shows the logic diagram of a 4-bit universal shift register.
19
3.Right shifting
The mode control input is connected to Logic 1 for parallel loading operation whereas
it is connected to 0 for serial shifting.When mode pin is connected to ground, the universal
shift register acts as a bi-directional register.For serial left operation, the input is applied to
serial input which goes into AND gate-1 of the above figure.For serial right operation, the
serial input is applied to D input (input of AND gate-8).The well known example of universal
shift register is in the form of IC 7495.
Universal Shift Register IC 7495:
It is a 4 bit shift register with serial and parallel synchronous operating modes.Because of its
capability to operate in all possible modes, it is called a universal shift register.
Some features of this chip are:
1.Synchronous shift left capacity.
2.Synchronous parallel loading is possible.
3.It has separate clock inputs,one for shift operation and the other for load operation.
4.The cascading of two or more 7495 ICs for more than 4-bits is possible.
A,B,C,D are the inputs to four internal flip flops with A acting as LSB and D as MSB. QA
through QD are the corresponding outputs.
IC 7495 is capable of performing the following operations:
1.Parallel loading (parallel input parallel output)
2.Left shifting
3.Right shifting
20
INTERNAL LOGIC DIAGRAM OF IC 7495
1.Parallel loading:
The connection diagram for IC 7495 in parallel input parallel output mode is as shown in the
figure below.The mode control (M) is connected to logic 1. This will enable the AND gates 2,
4, 6, 8 as shown in internal logic diagram. The AND gates 1, 3, 5, 7 are disabled.This allows
data transfer from the inputs A, B, C, D to the flip flops and disable
s the serial transfer of data. The 4-bit binary number which is to be loaded parallely is applied
to the A, B, C, D inputs.
The clock applied at clock-2 input only will be paused through the flip flops because with M=1
and AND gate-10 is enabled and gate-9 is disabled. As soon as a falling edge of clock is
applied, all flip-flops will change their status simultaneously and binary number applied to
ABCD inputs will be loaded into the shift register. The unused inputs such as serial input and
clock-1 can be left open or connected to ground because they are the don’t care options for
this mode.
21
2.Serial Shift Right Operation:
The connection for serial shift right mode is as shown in the figure below. Make mode control
= 0, therefore AND gates 1, 3, 5, 7 will be enabled and AND gate 2, 4, 6, 8 will get
disabled.Hence, the inputs ABCD become don’t care.
connected to C, Q to B and Q to A and the serial data is applied at input D.Mode control is
C B
connected to 1. Hence, the AND gates 2, 4, 6, 8 are enabled whereas 1, 3, 5, 7 are disabled.
This will make the serial input (pin no. 1) a don’t care input. The serial data is applied to D
which will be routed through the enabled AND gates 2, 4, 6, 8 to facilitate the right shifting
operation. As M = 1, AND gate - 10 is enabled and gate - 9 is disabled. So clock - 1 becomes
a don’t care input. Apply clock pulses to CLK - 2(shift left).Each high to low transition of clock
will transfer data from D to Q , Q to Q , Q to Q ,Q to Q .Thus the shift left operation is
D D C C B B A.
performed.
22
Q.6 Write Short notes on (any 2) (20)
(a)VHDL
Solution:
The long form of VHDL is Very High Speed Integrated Circuit (VHSIC) hardware description
language.
VHDL is used to form a digital system at many levels of ideas ranging from algorithmic level
to the gate level.
This language defines the syntax as well as simulation semantics for each language. It is a
strong typed language which contains too many words to write.
VHDL is difficult to understand because it provides wide ranging of modelling capabilities but
without learning the more complex features it is possible to incorporate a core subset of
language which is simple and easy to understand.
Some Features of VHDL are:
1. Strongly typed language: Only LHS and RHS operators of the same type are allowed
in VHDL.
2. Support hierarchies: Using VHDL, hierarchy can be represented. For example, full
adder.In this case it is composed of half adder and OR gate.
3. VHDL supports for test and simulation of programs.
4. Concurrency: VHDL is a concurrent language which executes statements
simultaneously in parallel.
5. VHDL supports different types of data modelling
(i)Structural
(ii)Data flow
(iii)Behavioural
(iv)Mixed
6. Supports sequential statement: VHDL can execute only one statement at a time in
sequence only.
7. VHDL supports synchronous and asynchronous models.
8. VHDL can be used as a communication model between different CAD and CAE
models.
Structure of VHDL module:
Design units of VHDL code are independent components which are separately combined and
stored in the library.
VHDL program is composed of the following design units:
1. Package (optional)
2. Entity
3. Architecture
4. Configuration (optional)
The diagram below shows the design units of VHDL.
23
Advantages of VHDL
1. VHDL allows designers to quickly develop designs requiring tens of thousands of
logic gates.
2. VHDL supports multiple level of hierarchy and modular design methods.
3. VHDL allows user to pick any synthesis tool.
4. VHDL is multipurpose i.e. once calculation block is created then it can be used in
many other projects.
5. For describing complex logic, VHDL provides powerful high level constructs.
Disadvantages of VHDL
VHDL is not a low level language i.e. gate level program. It is not suitable for
verification of basic objects like gates. Because in VHDL these objects are readily available.
Applications of VHDL
1. It is used in electronic design automation to describe mixed signal system such as
FPGA (Field Programmable Gate Arrays) and Integrated circuits.
2. VHDL can be used as a general purpose parallel programming language.
3. VHDL can also be used for design and simulation purposes.
24
8. TTL family has a speed power product of 100 pJ.
9. P of TTL does not depend on frequency.
D
CMOS family:
Complementary Metal Oxide Semiconductor (CMOS) is a technology for constructing
integrated circuits, employing MOSFET transistors. CMOS technology is used in
microprocessors, microcontrollers, static RAM, and other digital logic circuits. CMOS
technology is also used for several analog circuits such as image sensors (CMOS sensor),
data converters, and highly integrated transceivers for many types of communication. Some
characteristics of CMOS logic family are as follows:
1. CMOS devices are made up of N-channel MOSFET and P-channel MOSFET.
2. It has a high level noise margin of 1.45 V i.e. V = 1.45 V.
NH
floating.
12. CMOS usually have a high component density than TTL as MOSFETs need less
space while fabricating an IC.
13. MOSFETs are operated as switches i.e. in the ohmic region or cut off regions.
14. Power supply voltage of CMOS is flexible ranging from 3V to 15V.
Solution:
A 4-bit comparator is used to compare two 4-bit words A (A - A ) and B (B - B ). IC 7485 is a
3 0 3 0
four bit comparator in the integrated circuit form. It is possible to cascade more than one IC
7485 to compare words of almost any size.The figure below shows the pin configuration and
the logic symbol of IC 7485.
25
The Pin names and their functions are as shown in the table below:
A to A
0 3 10,12,13,15 Binary input (opearand 1) Active high
B to B
0 3 9,11,14,1 Binary input (opearand 2) Active high
I (A < B) 2 These lines are used for cascading a number of IC 7485 outputs of
I (A = B) 3 the previous stage are fed as inputs to this stage.
I (A > B) 4
A<B 7 These are the outputs. When ICs 7485 are cascaded, these outputs
A=B 6 are applied to cascading inputs of the next stage.
A>B 5
26
Comparing inputs Cascading inputs Outputs
A3,B3 A2,B2 A1,B1 A0,B0 A>B A<B A=B A>B A<B A=B
A3>B3 X X X X X X H L L
A3<B3 X X X X X X L H L
A3=B3 A2>B2 X X X X X H L L
A3=B3 A2<B2 X X X X X L H L
27
DLDA
(CBCGS MAY 2019)
Q1] a) Convert (451.43)10 into octal, binary and hexadecimal and base 7.
(04)
Solution :-
Decimal to octal
451 = 703
0.43 x 8 = 3.44 3
0.44 x 8 = 3.52 3
0.52 x 8 = 4.16 4
0.43 = (0.334)
(451.43)10 = (703.334)8
Decimal to binary
451 = 111000011
0.43 x 2 = 0.86 0
0.86 x 2 = 1.72 1
0.43 = 0.01
(451.43)10 = (111000011.01)2
Decimal to hexadecimal
451 = (1 12 3)
0.43 x 16 = 6.88 6
0.88 x 16 = 14.08 14
0.08 x 16 = 1.28 1
0.43 = (0.6 14 1)
(451.43)10 = (1 12 3.6 14 1)16
Decimal to base 7
451 = (1 2 1 3)
0.43 x 7 = 3.01 3
0.01 x 7 = 0.07 0
0.43 = (0.30)
(451.43)10 = (1213.30)7
Q1] b) Subtract using 1’s and 2’s complement method (73)10 – (49)10.
(04)
Solution :-
1’s complement method
Binary representation of 49 is 0110001
1’s complement of 49 is 1001110
1001110
+ 1001001
10010111
+ 1
10011000
1001110
+ 1
1001111
1001001
+ 1001111
1 00 11000
Discard carry 1
Therefore (73)10 - (49)10 = 11000 = (24)10.
99
- 68
31
52
+ 31
83
(52)10 - (68)10 = (83)
Statement: The complement of the product of two or more variables is equal to the sum of the
components of the variables.
Logical expression: ̅̅̅̅̅ ̅+B
A. B = A ̅
NAND is equal to BUBBLED OR.
A B A.B ̅̅̅̅̅
A. B ̅
A ̅
B ̅+B
A ̅
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
From the above truth table we can see that ̅̅̅̅̅ ̅+B
A. B = A ̅ Hence proved.
Theorem 2 :-
Statement: The complement of the sum of two or more variables is equal to the product of the
complement of the variables
Logical expression: ̅̅̅̅̅̅̅̅
𝐴 + 𝐵 = 𝐴̅. 𝐵̅
NOR is equal to BUBBLED AND.
A B A+B ̅̅̅̅̅̅̅
A+B ̅
A ̅
B ̅. B
A ̅
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
(04)
Solution :-
For given data of 9 bit, hamming code is given as
D13 D12 D11 D10 D9 P8 D7 D6 D5 P4 D3 P2 P1
P1: For P1 consider P1, D3, D5, D7, D9, D11, D13
D3, D5, D7, D9, D11, D13 = 100111
For even parity set P1 = 0
P2: For P2 consider P2, D3, D6, D7, D10, D11
D3, D6, D7, D10, D11 = 10001
For even parity set P2 = 0
P4: For P1 consider P4, D5, D6, D7, D12, D13
D5, D6, D7 = 00011
For even parity set P4 = 0
P8: For P1 consider P8, D9, D10, D11, D12, D13
D9, D10, D11, D12, D13= 10111
For even parity set P4 = 0
1 1 1 0 1 0 0 0 0 0 1 0 0
Q1] f) Explain SOP and POS and solve the following using K-Map
F(A,B,C,D)=πM(1,3,5,6,7,10,11)+d(2,4)
(04)
Solution :-
The sum-of-products (SOP) form is a method (or form) of simplifying the Boolean expressions of
logic gates. In this SOP form of Boolean function representation, the variables are operated by AND
(product) to form a product term and all these product terms are ORed (summed or added) together
to get the final function.
The product of sums form is a method (or form) of simplifying the Boolean expressions of logic
gates. In this POS form, all the variables are ORed, i.e. written as sums to form sum terms.
F(A,B,C,D)=πM(1,3,5,6,7,10,11)+d(2,4)
Fig.1.1 K map representation.
Equation form is
̅ + B) (A
Y = (A ̅ +D) (C+B
̅)
(04)
Solution :-
In counters, Lockout condition is that condition wherein a counter gets onto a forbidden state and
rather than coming out of it to another acceptable state or initial state, the counter switches to
another forbidden state and gets stuck up in the cycle of forbidden states only.
If by chance, the counter happens to find itself in any one of the unused states, its next state would
not be known. It may just be possible that the counter might go from one unused state to another
and never arrive at a used state. A counter whose unused states have this feature is said to suffer
from LOCK OUT.
To avoid lock out and make sure that at the starting point the counter is in its initial state or it comes
to its initial state within few clock cycles, external logic circuitry is to be provided and so we design
the counter assuming the next state to be the initial state, from each unused states.
In order to prevent lock out condition, use PRESET option and clear option in a flip flop and hence
the registers will be cleared and we can go for the smooth functioning of counter circuits.
Q2] a) Reduce equation using Quine McCluskey method and realize circuit using (10)
basic gates.
-F(A,B,C,D) = Σm (1,5,6,12,13,14) + d(2,4)
(10)
Solution :-
Table 1
Group Minterm Binary Representation
A B C D
0 m1 0 0 0 1
m2* 0 0 1 0
m4* 0 1 0 0
1 m5 0 1 0 1
m6 0 1 0 1
m12 0 1 1 0
2 m13 1 1 0 1
m14 1 1 1 0
Table 2
Table 3
Group Minterm Binary Representation
A B C D
0 M4-m5-m12-m13* _ 1 0 _
M4-m12-m5-m13* _ 1 0 _
M4-m12-m6-m14* _ 1 _ 0
PI Decimal of PI 1 5 6 12 13 14 2 4
Y = B𝐂̅ + 𝐁
̅D
(10)
Solution :-
4 Bit BCD subtractor
IC 7483 performs the addition of two 4-bit BCD numbers A3 A2 A1 A0 and B3 B2 B1 B0 and carry input
to give the output S3 S2 S1 S0 and carry out. So for adding the two numbers A3 A2 A1 A0 and B3 B2
B1 B0, the two numbers are given to input terminals 1,3,8,10 and 16,4,7,11 of the IC 7483 and carry
in the terminal 13 is set to zero. To subtract two numbers by two’s complement method, we are adding
the 2’s complement of the second number to each of the four bits of the first numbers. The final carry
is neglected and the difference is taken from S3 S2 S1 S0.
In the circuit we set mode control such that when the mode control is zero, addition is performed and
subtraction is performed when the mode control is one. We use XOR gates to feed the input so that
when control is one, the complement of each of the four bits are fed and mode control is zero, the
input as such is fed.
In 1’s complement subtraction, the complement of the subtraction is taken and added with the other
number. The final carry is then added to LSB of the result. In case there is no carry, the complement
of the result is taken and this will be a negative number. This indicates that, subtraction is performed
from a smaller number.
(05)
Solution :-
Step 1: Draw a table
If both the values in the column are included than it is connected to 1. If both the values of the column
are not included than it is connected to input 0. So, for the given question the mux drawn is given
below.
(05)
Solution:-
Truth table of full subtractor
X Y Z D B
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
D=X ⊕Y⊕Z
B=̅ ̅̅
XY +X Y Z + XYZ
Q3] c) Design a logic circuit to convert 4-bit gray code to its corresponding BCD code.
(10)
Solution:-
Step1: Write the truth table of Gray code and its equivalent binary code is as shown in table:
Step2: Write K – map for each binary output and get simplified expression The K – map for various
binary outputs and the corresponding simplified expression are given below:
For output B3
B0 = G0 ̅̅̅̅̅̅̅̅̅̅̅̅
G1 G2 G3 + G2 ̅̅̅̅̅̅̅̅̅̅̅̅
G3 G1 G0 + G1 ̅̅̅̅̅̅̅̅̅̅̅̅
G3 G2 G0 + G1 ̅̅̅̅̅̅̅̅̅̅̅̅
G3 G2 G0 + G2 ̅̅̅̅
G3 G1 G0 + G2 ̅̅̅̅
G1 G3 G0 +
̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅̅̅
G2 G0 G3 G1 + G3 G1 G2 G0 + G0 G2 G3 G1 ̅̅̅̅
= ̅̅̅̅̅̅̅̅̅
G0 G1 (G2⊕G3) + G0 G1 ̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅ (G3 ⊕ G2 ) + G0 G1 ̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅ (G3 ̅̅̅̅̅̅̅̅̅̅̅̅
̅̅̅̅ (G3
⊕ G2 ) + G1 G0 ⊕ G2 )
= (G2⊕G3) + (G1 ̅̅̅̅̅̅̅̅̅̅̅̅
⊕ G0 ) +(G1⊕G0) + (G3 ̅̅̅̅̅̅̅̅̅̅̅̅
⊕ G2 )
= Y̅ X + Y X̅
Where X = (G2⊕G3) and Y=(G1⊕G0)
= (G2⊕G3) ⊕ (G1⊕G0)
= G2⊕G3⊕G1⊕G0
Step3: Realization
The Gray to Binary code converter is as shown in figure given below
Fig. 3.5 Gray code to binary converter
Q4] a) Compare different logic families with respect to fan in, fan out, speed,
Propogation delay and power dissipation.
(05)
Solution :-
Parameter ECL DTL TTL IIL CMOS
Fan in - - 12-14 - Greater than
10
Fan out 25 Medium (8) High (10) 8-11 50
Speed X Power 100 300 100 Less than 1 70
Propagation 1-2 30 10 25-2500 70
Delay (ns)
Power 40-45 8-12 10 5-25 01
Dissipation (mW)
(05)
Solution :-
Truth table:-
A B C X Y Z
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 1
0 1 1 0 1 0
1 0 0 1 1 0
1 0 1 1 1 1
1 1 0 1 0 1
1 1 1 1 0 0
Formulae:-
Let b2 b1 b0 be the 3-bit binary number and g2 g1 g0 be its equivalent gray code.
Then,
g2 = b2
g1 = b2 ⊕ b1
g0 = b1 ⊕ b0
(10)
Solution :-
• The binary information (data) in a register can be moved from stage to stage within the
register or in or out of the register upon applications of clock pulses.
• This type of bit movement or shifting is essential for certain application like arithmetic and
logic operations used in Microprocessors.
• This group of registers are called as ‘Shift Register’
• Bidirectional shift register allows shifting of data either to left or to the right side.
• It can be implemented using logic gates circuitry that enables the transfer of data from one
stage to the next stage to the right or to the left, depend on the level of control line.
• The RIGHT/LEFT is the control input signal which allows data shifting either towards right or
towards left.
• A high on this line enables the shifting of data towards right and low enables it towards left.
• When RIGHT/LEFT is high, gates G1, G2, G3 and G4 are enabled.
• The state of Q output of each flip flop is passed through the D input of the following flip flop.
• When the pulse arrives, the data are shifted one place to the right.
• When the RIGHT/LEFT signal is low, gates G5, G6, G7 are enabled.
• The Q output of each flip-flop is passed through the D input of the preceding flip-flop.
(10)
Solution :-
A synchronous counter is one which has the same clock input for all its flip flops. A MOD 13
synchronous counter counts from 0000 to 1101. Hence it will require four T flip flops. Synchronous
counters are designed by using excitation table to determine the combinational logic of inputs to
each flip flop. The excitation table for all the four T flip flops is shown:
Present state Next state T Flipflop
QD QC QB QA QD + QC+ QB + QA + TD TC TB TA
0 0 0 0 0 0 0 1 0 0 0 1
0 0 0 1 0 0 1 0 0 0 1 1
0 0 1 0 0 0 1 1 0 0 0 1
0 0 1 1 0 1 0 0 0 1 1 1
0 1 0 0 0 1 0 1 0 0 0 1
0 1 0 1 0 1 1 0 0 0 1 1
0 1 1 0 0 1 1 1 0 0 0 1
0 1 1 1 1 0 0 0 1 1 1 1
1 0 0 0 1 0 0 1 0 0 0 1
1 0 0 1 1 0 1 0 0 0 1 1
1 0 1 0 0 0 0 0 1 0 1 0
1 0 1 1 X X X X X X X X
1 1 0 0 X X X X X X X X
1 1 0 1 X X X X X X X X
1 1 1 0 X X X X X X X X
1 1 1 1 X X X X X X X X
Fig 5.a Excitation table for MOD 13 synchronous counter
From the above excitation table, we can draw k maps to determine input to every flipflop
Four equations for four T flipflop are obtained. Using them, the MOD 13 synchronous counter is
designed as follows:
Fig 5.2 MOD 13 synchronous counter using T flipflop
(10)
Solution:-
SR to JK
a) Excitation Table
Input’s Present State Next State Flip Flop Input
J K Qn Qn+1 S R
0 0 0 0 0 X
0 1 0 0 0 X
1 0 0 1 1 0
1 1 0 1 1 0
0 0 1 0 0 1
0 1 1 0 0 1
1 0 1 1 X 0
1 1 1 1 X 0
b) K- map simplification
c) Logic diagram
SR to D
a) Excitation Table
D Qn Qn+1 S R
0 0 0 0 X
1 0 1 1 0
0 1 0 0 1
1 1 1 X 0
b) K-map simplification
c) Logic diagram
Q6] a) ALU
(05)
Solution :-
The arithmetic logic unit is that part of the CPU that handles all the calculations the CPU may need.
Most of these operations are logical in nature. Depending on how the ALU is designed, it can make
the CPU more powerful, but it also consumes more energy and creates more heat. Therefore, there
must be a balance between how powerful and complex the ALU is and how expensive the whole unit
becomes. This is why faster CPUs are more expensive, consume more power and dissipate more
heat.
The main functions of the ALU are to do arithmetic and logic operations, including bit shifting
operations. These are essential processes that need to be done on almost any data that is being
processed by the CPU.
ALUs routinely perform the following operations:
Logical Operations: These include AND, OR, NOT, XOR, NOR, NAND, etc.
Bit-Shifting Operations: This pertains to shifting the positions of the bits by a certain number of
places to the right or left, which is considered a multiplication operation.
Arithmetic Operations: This refers to bit addition and subtraction. Although multiplication and
division are sometimes used, these operations are more expensive to make. Addition can be used to
substitute for multiplication and subtraction for division.
(05)
Solution :-
Asynchronous counters are those whose output is free from the clock signal. Because the flip flops in
asynchronous counters are supplied with different clock signals, there may be delay in producing
output.
By adding up the ideas of UP counter and DOWN counters, we can design asynchronous up /down
counter. The 3 bit asynchronous up/ down counter is shown below.
It can count in either ways, up to down or down to up, based on the clock signal input.
UP Counting
If the UP input and down inputs are 1 and 0 respectively, then the NAND gates between first flip flop
to third flip flop will pass the non-inverted output of FF 0 to the clock input of FF 1. Similarly, Q
output of FF 1 will pass to the clock input of FF 2. Thus, the UP /down counter performs up counting.
DOWN Counting
If the DOWN input and up inputs are 1 and 0 respectively, then the NAND gates between first flip
flop to third flip flop will pass the inverted output of FF 0 to the clock input of FF 1. Similarly, Q
output of FF 1 will pass to the clock input of FF 2. Thus, the UP /down counter performs down
counting.
The up/ down counter is slower than up counter or a down counter, because the addition
propagation delay will be added to the NAND gate network.
(05)
Solution:-
An encoder has 2n or fewer input lines, only one of which is in the “1” state at a particular time and
an n-bit code is generated on “n” output lines depending upon which of the input is excited. In
other words, an encoder is a circuit in which output lines generate the binary code corresponding to
the input value.
An octal to binary encoder has 23 = 8 input lines D0 to D7 and 3 output lines Y0to Y2. Below is
the truth table for an octal to binary encoder.
Fig.6.c Truth Table of octal to binary encoder.
From the truth table, the outputs can be expressed by following Boolean Function.
Y0 = D1 + D3 + D5 + D7
Y1 = D2 + D3 + D6 + D7
Y2 = D4 + D5 + D6 + D7
Above boolean functions are formed by ORing all the input lines for which output is 1. For instance
Y0 is 1 for D1, D3, D5, D7 input lines. The encoder can therefore be implemented with OR gates
whose inputs are determined directly from truth table.
(05)
Solution :-
A Universal shift register is a register which has both the right shift and left shift with parallel load
capabilities. Universal shift registers are used as memory elements in computers. A Unidirectional
shift register is capable of shifting in only one direction. A bidirectional shift register is capable of
shifting in both the directions. The Universal shift register is a combination design
of bidirectional shift register and a unidirectional shift register with parallel load provision.
The register operations performed for the various inputs of select lines are as follows:
S1 S0 REGISTER OPERATION
0 0 No changes
0 1 Shift Right
1 0 Shift Left
1 1 Parallel Load
4-bit universal shift register is built with four blocks each constituted of a 4X1 mux and a D-flipflop.
All the blocks are essentially identical. Because all the multiplexers in the register are wired similarly,
The L inputs come through port 11, which is why the L inputs are readable only when S1S0 = 11. The
feedback Q wires are connected at port 00, so that when S1S0 = 00 the output Q of the D-flipflops
feed back into the flipflops’ inputs resulting in no total change in the register content. Port 01 is
wired to facilitate right-shifts. In mode S1S0 = 01 only port 01 is active and it takes its value from the
previous more significant flipflop and passes it down to the flipflop wired to its mux output. Lastly
port 10 is wired to conduce to left-shifts. Being the only active port when S1S0 = 10, it remits the
output of the less significant flipflop sourcing into it to the flipflop wired to its mux output. As a
consequence of this wiring pattern where each block of the register is an exact replica of any other
block, the selector switches are able to align the behavior of all the multiplexers simultaneously. This
coincidence of behavior is what we refer to as mode behavior of the universal register.
Q6] e) VHDL
(05)
Solution :-
VHDL stands for very high-speed integrated circuit hardware description language. This language was
first introduced in 1981 for the department of Defense (DoD) under the VHSIC program.
VHDL is a hardware description language that can be used a model a digital system at many levels of
abstraction, ranging from the algorithmic level to the gate levels.
Structure of VHDL Module:
The Main component of VHDL module consist of following declaration.
1) Package
2) Entity
3) Architecture
4) Configuration
The following fig. shows the relationship of these basic blocks of VHDL program.
A design may include any number of packages, entity, and Architecture and configuration
declaration.
The entity and architecture blocks are compulsory but packages and configuration blocks are
optional.
MUMBAI UNIVERSITY
DIGITAL LOGIC DESIGN & ANALYSIS
SEMESTER 3 – CBCGS – DECEMBER 2019
Q.1 a) What are Universal gates? Why they are called so ?Explain with suitable
Example . [4M]
Ans : i) A universal gate is a gate which can implement any Boolean function without
use any other gate type.
ii) The NAND and NOR gates are universal gates.
iii) AND and NOR are called universal gates because all the other gates like
and,or,not,xor and xnor can be derived from it.
iv) NAND GATE :
A B Y
0 0 1
0 1 1
1 0 1
1 1 0
NOR GATE :
A B Y
0 0 1
0 1 0
1 0 0
1 1 0
MUQuestionPapers.com
Q.P CODE:76197
Note : 7's complement of a number is obtained by subtracting all bits from 77.
7's complement of 11 is 77-11 = 66
Add it in A i.e in 12 ,
12 + 66 = 100
Here in 7s complement substraction we add carry in LSB
∴ 00 + 1 = 01
∴ (20)5 − (14)5 = (01)8
MUQuestionPapers.com
Q.P CODE:76197
9 9
- 1 0
8 9
Now add 1 : 89 + 1 = 90
MUQuestionPapers.com
Q.P CODE:76197
+ 9 0
1 2 4
MUQuestionPapers.com
Q.P CODE:76197
Q.2 a) Reduce using Quine McClusky Method & realize the operation using
NOR gates only.
F = ∑ 𝒎(𝟎, 𝟏, 𝟐, 𝟖, 𝟏𝟎, 𝟏𝟏, 𝟏𝟒, 𝟏𝟓) [10M]
Ans : The given function contains min terms and truth table and Quine
McClusky method is given
MUQuestionPapers.com
Q.P CODE:76197
Finding all prime implicants of the function.Use those prime implicants in a prime
implicant chart to find the essential prime implicants of the function, as well as other
prime implicants that are necessary to cover the function
A B C D Y
0 0 0 0 1
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 1
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 0
1 1 0 1 0
1 1 1 0 1
1 1 1 1 1
∴ y = B'D' + AC + A'B'C'
MUQuestionPapers.com
Q.P CODE:76197
Implementation :
MUQuestionPapers.com
Q.P CODE:76197
II)The two BCD digits are to be added using the rules of binary addition.
III) If sum is less than or equal to 9 and carry is 0, then no correction is needed. The sum is
correct and in true BCD form.
IV) But if sum is greater than 9 or carry =1, the result is wrong and correction must be done.
The wrong result can be corrected adding six (0110) to it.
V) For implementing a BCD adder using a binary adder circuit IC 7483, additional
combinational circuit will be required, where the Sum output S3−S0S3−S0 is checked
for invalid values from 10 to 15. The truth table and K-map for the same is as shown:
MUQuestionPapers.com
Q.P CODE:76197
MUQuestionPapers.com
Q.P CODE:76197
Example :
Thus,
Cout = 1
S3S2S1S0=0000 S3S2S1S0=0000
Hence, for adder, inputs will be
A3A2A1A0=0000 A3A2A1A0=0000
B3B2B1B0=0110 B3B2B1B0=0110
This will give final output as
Cout S3S2S1S0=10110 S3S2S1S0=10110.
Q.3 (a) Construct 32:1 MUX using 8:1 MUX only.Also comment about select lines used
[10M]
Ans :
i) In electronics, a multiplexer (or mux), also known as a data selector, is a device that
selects between several analog or digital input signals and forwards it to a single output
line.
ii) The multiplexer is a combinational logic circuit designed to switch one of several
input lines to a single common output line.
iii) Multiplexer are of different types .Example 2:1 MUX , 4:1 MUX , 8:1 MUX , 16:1
MUX ,32:1 MUX ,etc.
iv) We can implement a MUX using different types of MUX .For example , we can
Construct 32:1 MUX using 8:1 MUX only.
MUQuestionPapers.com
Q.P CODE:76197
Comment on select lines : i) From circuit diagram , we can see that S0 S1 S2 select
lines are used to select MUX which are connected to the main data lines.
ii)There are select lines such as S5 S4 S3 used to select this multiple MUXes .
MUQuestionPapers.com
Q.P CODE:76197
A B C D Y
0 0 0 0 1
0 0 0 1 1
0 0 1 0 1
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 1
1 0 0 1 1
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0
KMAP :
MUQuestionPapers.com
Q.P CODE:76197
Circuit Diagram :
c) Design full adder using half adders and few gates. [5M]
Ans : Half Adder : The addition of 2bits is called Half adder the input variebles are
augent and addent bits and output variebles are sum&carry bits.
Full Adder : Full Adder is the adder which adds three inputs and produces two
outputs. The first two inputs are A and B and the third input is an input carry as C-
IN. The output carry is designated as C-OUT and the normal output is designated
as S which is SUM.
A B C Y(SUM) Y(CARRY)
0 0 0 0 0
0 0 1 1 0 A B Y(SUM) Y(CAR
0 1 0 1 0 RY)
0 1 1 0 1 0 0 0 0
1 0 0 1 0 0 1 1 0
1 0 1 0 1 1 0 1 0
1 1 0 0 1 1 1 0 1
1 1 1 1 1
HALF ADDER
MUQuestionPapers.com
Q.P CODE:76197
MUQuestionPapers.com
Q.P CODE:76197
Q.4 a) Convert SR flip flop to JK flip flop and T flip flop. [10M]
Ans : A) SR flip flop to JK flip flop :
I) The truth tables for the flip flop conversion are given below. The present state is
represented by Qp and Qp+1 is the next state to be obtained when the J and K
inputs are applied.
II)For two inputs J and K, there will be eight possible combinations. For each
combination of J, K and Qp, the corresponding Qp+1 states are found. Qp+1
simply suggests the future values to be obtained by the JK flip flop after the value
of Qp. The table is then completed by writing the values of S and R required to get
each Qp+1 from the corresponding Qp. That is, the values of S and R that are
required to change the state of the flip flop from Qp to Qp+1 are written.
Truth Table :
J K 𝑄𝑃 𝑄𝑃+1 S R
0 0 0 0 0 X
0 0 0 1 X 0
0 0 1 0 0 X
0 0 1 0 0 1
0 1 0 1 1 0
0 1 0 1 X 0
0 1 1 1 1 0
0 1 1 0 0 1
MUQuestionPapers.com
Q.P CODE:76197
Circuit :
MUQuestionPapers.com
Q.P CODE:76197
1. Connect the S input to the output of a two-input AND gate which is driven
by the user-provided input, T, and the negation of the flip-flop's present-
state, Q̅n
2. Connect the R input to the output of a two-input AND gate which is
driven by the user-defined input, T, and the present-state of the flip-flop,
Qn
Circuit :
MUQuestionPapers.com
Q.P CODE:76197
Truth table :
State Qc Qb Qa State Qc Qb Qa
0 0 0 0 7 1 1 1
1 0 0 1 6 1 1 0
2 0 1 0 5 1 0 1
3 0 1 1 4 1 0 0
4 1 0 0 3 0 1 1
5 1 0 1 2 0 1 0
6 1 1 0 1 0 0 1
7 1 1 1 0 0 0 0
i)For up down counting operation preceding flip-flop sometime it need input from
output from output Q of first flip-flop to clock of next flip-flop for up-counting and
sometimes from output Q^ of first flip-flop to clock of next flip-flop for down-
counting. So in above circuit diagram it is shown clearly.
ii) As we know a flip-flop can hold single bit so for 3 bit operation it need three
flip-flops.
iii)An inverter has been inserted in between the count-up control line and the
count-down control line to ensure that the count-up and count-down cannot be
simultaneously in the HIGH state.
iv)When the count-up/down line is held HIGH, the lower AND gates will be
disabled and their outputs will be zero.
MUQuestionPapers.com
Q.P CODE:76197
v) So they will not affect the outputs of the OR gates. At the same time the upper
AND gates will be enabled. Hence, QA will pass through the OR gate and into the
clock input of the B flip-flop.
vi)Similarly, QB will be gated into the clock input of the C flip-flop. Thus, as the
input pulses are applied, the counter will count up and follow a natural binary
counting sequence from 000 to 111.
vii)Similarly, with count-up/down line being logic 0, the upper AND gates will
become disabled and the lower AND gates are enabled, allowing Q′A and Q′B to
pass through the clock inputs of the following flip-flops.
viii)Hence, in this condition the counter will count in down mode, as the input
pulses are applied.
Designed Circuit :
MUQuestionPapers.com
Q.P CODE:76197
A B C D GRAY CODE
0 0 0 0 0000
0 0 0 1 0001
0 0 1 0 0011
0 0 1 1 0010
0 1 0 0 0110
0 1 0 1 0111
0 1 1 0 0101
0 1 1 1 0100
1 0 0 0 1100
1 0 0 1 1101
1 0 1 0 1111
1 0 1 1 1110
1 1 0 0 1010
1 1 0 1 1011
1 1 1 0 1001
1 1 1 1 1000
MUQuestionPapers.com
Q.P CODE:76197
G4=∑m(8,9,10,11,12,13,14,15), G3=∑m(4,5,6,7,8,9,10,11)
G2=∑m(2,3,4,5,10,11,12,13), G1=∑m(1,2,5,6,9,10,13,14)
MUQuestionPapers.com
Q.P CODE:76197
MUQuestionPapers.com
Q.P CODE:76197
iii) A magnitude digital Comparator is a combinational circuit that compares two digital
or binary numbers in order to find out whether one binary number is equal, less than
or greater than the other binary number.
iv) We logically design a circuit for which we will have two inputs one for A and other
for B and have three output terminals, one for A > B condition, one for A = B condition
and one for A < B condition.
A A>B
B COMPARATOR A<B
A==B
Logical expression :
A>B : AB'
A<B : A'B
A=B : A'B' + AB
MUQuestionPapers.com
Q.P CODE:76197
MUQuestionPapers.com
Q.P CODE:76197
iv) The complementary metal oxide semiconductor family (CMOS) has equivalents
to most of the TTL chips.
v) CMOS chips are much lower in power requirements (drawing about 1 mA) and
operate with a wide range of supply voltages (typically 3 to 18 volts).
vi) The CMOS model number will have a C in the middle of it, e.g., the 74C04 is the
CMOS equivalent to the TTL 7404.
MUQuestionPapers.com
Q.P CODE:76197
D) ALU :
i) An arithmetic logic unit (ALU) is a digital circuit used to perform arithmetic and
logic operations.
MUQuestionPapers.com
Q.P CODE:76197
ii) It represents the fundamental building block of the central processing unit
(CPU) of a computer. Modern CPUs contain very powerful and complex ALUs. In
addition to ALUs, modern CPUs contain a control unit (CU).
iii) Most of the operations of a CPU are performed by one or more ALUs, which
load data from input registers. A register is a small amount of storage available as
part of a CPU.
iv) The control unit tells the ALU what operation to perform on that data, and the
ALU stores the result in an output register. The control unit moves the data
between these registers, the ALU, and memory.
v) An ALU performs basic arithmetic and logic operations. Examples of arithmetic
operations are addition, subtraction, multiplication, and division. Examples of
logic operations are comparisons of values such as NOT, AND, and OR.
vi) All information in a computer is stored and manipulated in the form of binary
numbers, i.e. 0 and 1. Transistor switches are used to manipulate binary numbers
since there are only two possible states of a switch: open or closed.
vii) An open transistor, through which there is no current, represents a 0. A
closed transistor, through which there is a current, represents a 1.
i) A twisted ring counter, also called switch-tail ring counter, walking ring
counter, Johnson counter, or Möbius counter, connects the complement of the
output of the last shift register to the input of the first register and circulates a
stream of ones followed by zeros around the ring.
ii)Ring counters are often used in hardware design (e.g. ASIC and FPGA design) to
create finite-state machines .
iii) A binary counter would require an adder circuit which is substantially more
complex than a ring counter and has higher propagation delay as the number of
bits increases, whereas the propagation delay of a ring counter will be nearly
constant regardless of the number of bits in the code.
MUQuestionPapers.com