0% found this document useful (0 votes)
47 views

DLD Second Assignment (15-FEB-17)

The document is an assignment submission that contains questions and answers about digital logic design and microprocessors. It includes: 1) Explanations of a half adder and full adder with truth tables and logic diagrams. 2) Descriptions and truth tables of D and JK flip-flops. 3) An overview of basic microprocessor architecture including the arithmetic logic unit (ALU), registers, program counter, stack pointer, and instruction register. 4) Explanations of the functions of the address bus, data bus, and control bus. 5) Descriptions of the ALU, program counter, stack pointer, and instruction registers in a microprocessor.

Uploaded by

Adil ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

DLD Second Assignment (15-FEB-17)

The document is an assignment submission that contains questions and answers about digital logic design and microprocessors. It includes: 1) Explanations of a half adder and full adder with truth tables and logic diagrams. 2) Descriptions and truth tables of D and JK flip-flops. 3) An overview of basic microprocessor architecture including the arithmetic logic unit (ALU), registers, program counter, stack pointer, and instruction register. 4) Explanations of the functions of the address bus, data bus, and control bus. 5) Descriptions of the ALU, program counter, stack pointer, and instruction registers in a microprocessor.

Uploaded by

Adil ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Page 1 of 16

Assignment No.2

Digital And Logic Design

(Section 2016-2018)
Submitted To:

USMAN ZULFIQAR

Submitted By:

KHURRAM SHEHZAD AHMAD

(Roll # 165840)

(Class: M.Sc. (IT))

(Group C)

Department of Information Technology

Government College University Faisalabad

Second Assignment | Digital and Logic Design


Page 2 of 16

Question No.1
1. What is a half-adder and full-adder? Explain a half-adder and full-adder with the
help of truth-table and logic diagram?
2. Write the note on the following also draw Graphic symbol and truth table each of
the following:
1. D Flip-Flop
2. JK Flip-Flop

What is a half-adder and full-adder? Explain a half-adder and full-adder with the help
of truth-table and logic diagram?

Half Adder:-
An adder is a digital circuit that performs addition of numbers. The half adder
adds two binary digits called as augend and addend and produces two outputs as sum
and carry; XOR is applied to both inputs to produce sum and AND gate is applied to
both inputs to produce carry.
Logic Diagram:-

Truth Table:-

Full adder:-
The full adder adds 3 one bit numbers, where two can be referred to as
operands and one can be referred to as bit carried in. And produces 2-bit output, and
these can be referred to as output carry and sum.
Logic diagram:-

Second Assignment | Digital and Logic Design


Page 3 of 16

Truth table:-

Write the note on the following also draw Graphic symbol and truth table each of the
following:
1. D Flip-Flop
2. JK Flip-Flop

D Flip-Flop:-
The D input goes directly into the S input and the complement of the D input
goes to the R input. The D input is sampled during the occurrence of a clock pulse. If
it is 1, the flip-flop is switched to the set state (unless it was already set). If it is 0, the
flip-flop switches to the clear state.
Logic diagram:-

Graphical symbol:-

Truth Table:- Q D Q(t+1)


0 0 0
0 1 1
1 0 0
1 1 1
Second Assignment | Digital and Logic Design
Page 4 of 16

J flip-flop:-
A JK flip-flop is a refinement of the SR flip-flop in that the indeterminate
state of the SR type is defined in the JK type. Inputs J and K behave like inputs S and
R to set and clear the flip-flop (note that in a JK flip-flop, the letter J is for set and the
letter K is for clear). When logic 1 inputs are applied to both J and K simultaneously,
the flip-flop switches to its complement state, ie., if Q=1, it switches to Q=0 and vice
versa.
Output Q is ANDed with K and CP inputs so that the flip-flop is cleared
during a clock pulse only if Q was previously 1. Similarly, output Q' is ANDed with J
and CP inputs so that the flip-flop is set with a clock pulse only if Q' was previously
1.
Note that because of the feedback connection in the JK flip-flop, a CP signal
which remains a 1 (while J=K=1) after the outputs have been complemented once
will cause repeated and continuous transitions of the outputs. To avoid this, the clock
pulses must have a time duration less than the propagation delay through the flip-flop.
The restriction on the pulse width can be eliminated with a master-slave or edge-
triggered construction. The same reasoning also applies to the T flip-flop presented
next.
Symbol And Circuit Diagram:-
The symbol and circuit diagram are given below:

Truth Table:-

Q J K Q(t+1)
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0

Second Assignment | Digital and Logic Design


Page 5 of 16

Question No.2
1. Draw and explain basic microprocessor architecture?
2. Explain in brief the functions of address bus, Data bus and control bus for a basic
microprocessor?
3. Explain the functions of following in microprocessor:
(1) ALU
(2) Program counter
(3) Stack pointer
(4) Instruction registers

Draw and explain basic microprocessor architecture?

Arithmetic-Logic Unit (ALU):-


The arithmetic-logic unit is a combinational network that performs arithmetic
and logical operations on the data.
Internal Registers:-
A number of registers are normally included in the microprocessor. These are
used for temporary storage of data, instructions and addresses during execution of a
program. Those in the Intel P ALU REGISTER ARRAY INPUT ROM RAM
MEMORY CONTROL INTERNAL BUS) (ADDRESS, DATA OUTPUT 4
Advanced Microprocessors 8085 microprocessor is typical and are described below:
Accumulator (Acc) or Result Register:-
This is an 8-bit register used in various arithmetic and logical operations. Out
of the two operands to be operated upon, one comes from accumulator (Acc), whilst
the other one may be in another internal register or may be brought in by the data bus
from the main memory. Upon completion of the arithmetic/logical operation, the
result is placed in the accumulator (replacing the earlier operand). Because of the later
function, this register is also called as result register.
General Purpose Registers or Scratch Pad Memory:-
There are six general purpose 8-bit registers that can be used by the
programmer for a variety of purposes. These registers, labelled as B, C, D, E, H and
L, can be used individually (e.g., when operation on 8-bit data is desired) or in pairs

Second Assignment | Digital and Logic Design


Page 6 of 16

(e.g., when a 16-bit address is to be stored). Only B-C, D-E and H-L pairs are
allowed.
Instruction Register (IR):-
This 8-bit register stores the next instruction to be executed. At the proper
time this stored word (instruction) is fed to an instruction decoder which decodes it
and supplied appropriate signals to the control unit. When the execution has been
accomplished the new word in the instruction register is processed.
Program Counter (PC):-
This is a 16-bit register which holds the address of the next instruction that has
to be fetched from the main memory and loaded into the instruction register. The
program controlling the operation is stored in the main memory and instructions are
retrieved from this memory normally in order. Therefore, normally the address
contained in the PC is incremented after each instruction is fetched. However, certain
classes of instruction can modify the PC so that the programmer can provide for
branching away from the normal program flow. Examples are instructions in the
jump and call subroutine groups.
Stack Pointer (SP):-
This is also a 16-bit register and is used by the programmer to maintain a
stack in the memory while using subroutines.

Explain in brief the functions of address bus, Data bus and control bus for a basic
microprocessor?

Address Bus:-
Address bus is a part of the computer system bus that is dedicated for
specifying a physical address.
When the computer processor needs to read or write from or to the
memory, it uses the address bus to specify the physical address of the
individual memory block it needs to access (the actual data is sent along
the data bus).
Data Bus:-
A data bus simply carries data.
Typically, the same data bus is used for both read/write operations.
When it is a write operation, the processor will put the data (to be written)
on to the data bus.
When it is the read operation, the memory controller will get the data from
the specific memory block and put it in to the data bus.
Control Bus:-
Microprocessor uses control bus to process data, that is what to do
with the selected memory location. Some control signals are Read, Write and Opcode
fetch etc. Various operations are performed by microprocessor with the help of
control bus. This is a dedicated bus, because all timing signals are generated
according to control signal.

Explain the functions of following in microprocessor:


(1) ALU
(2) Program counter
(3) Stack pointer
(4) Instruction registers
Second Assignment | Digital and Logic Design
Page 7 of 16

ALU:-
The ALU is responsible for performing all logical and arithmetic operations.
- Some of the arithmetic operations are as follows: addition, subtraction,
multiplication and division.
- Some of the logical operations are as follows: comparison between numbers, letter
and or special characters.
- The ALU is also responsible for the following conditions: Equal-to conditions,
Less-than condition and greater than condition
Program counter:-
A program counter is a register in a computer processor that contains the
address (location) of the instruction being executed at the current time. As each
instruction gets fetched, the program counter increases its stored value by 1. After
each instruction is fetched, the program counter points to the next instruction in the
sequence. When the computer restarts or is reset, the program counter normally
reverts to 0.
Stack pointer:-
A stack pointer is a small register that stores the address of the last program
request in a stack. A stack is a specialized buffer which stores data from the top
down. As new requests come in, they "push down" the older ones. The most recently
entered request always resides at the top of the stack, and the program always takes
requests from the top.
A stack (also called a pushdown stack) operates in a last-in/first-out sense.
When a new data item is entered or "pushed" onto the top of a stack, the stack pointer
increments to the next physical memory address, and the new item is copied to that
address. When a data item is "pulled" or "popped" from the top of a stack, the item is
copied from the address of the stack pointer, and the stack pointer decrements to the
next available item at the top of the stack.
Instruction registers:-
An instruction register (IR) is the part of a CPU control unit that holds the
instruction currently being executed or decoded. In simple processors each instruction
to be executed is loaded into the instruction register which holds it while it is
decoded, prepared and ultimately executed, which can take several steps.
Once an instruction is fetched from main memory, it is stored in the
Instruction Register. The control unit takes instruction from this register, decodes and
executes it by sending signals to the appropriate component of computer to carry out
the task.

Question No.3
1. What is Karnaugh Map? Simplify the following expression Construct Karnaugh map
and tabulation
Method for variable A, B, C, D, E.
F(A,B,C,D,E) = (0,2,4,6,9,11,13,15,17,21,25,27,29,31)
2. Simply the following Boolean function using K-map and tabulation method
F(v,w,x,y,z)= (0,1,4,5,16,17,21,25,29)
3. Distinguish between a gate and a circuit.
Draw a circuit diagram corresponding to the following Boolean expression:
(A + B)(B + C)
Draw a circuit diagram corresponding to the following Boolean expression:
Second Assignment | Digital and Logic Design
Page 8 of 16

(AB + C)D
4. Show the behavior of the following circuit with a truth table:
A

Show the behavior of the following circuit with a truth table:


A

What is Karnaugh Map? Simplify the following expression Construct Karnaugh map
and tabulation
Method for variable A, B, C, D, E.
F(A,B,C,D,E) = (0,2,4,6,9,11,13,15,17,21,25,27,29,31)

Karnaugh Map:-
A Karnaugh map provides a pictorial method of grouping together expressions
with common factors and therefore eliminating unwanted variables. The Karnaugh
map can also be described as a special arrangement of a truth table.
Construct Karnaugh Map And Tabulation:-
Solution:-

F(A,B,C,D,E) = (0,2,4,6,9,11,13,15,17,21,25,27,29,31)

= m0+m2+m4+m6+m9+m11+m13+m15+m17+m21+m25+m27+m29+m31

Answer:-

F = + + + +

Second Assignment | Digital and Logic Design


Page 9 of 16

Simply the following Boolean function using K-map and tabulation method
F(v,w,x,y,z)= (0,1,4,5,16,17,21,25,29)

Construct Karnaugh Map And Tabulation:-


Solution:-

F(v,w,x,y,z)= (0,1,4,5,16,17,21,25,29)

= m0+m1+m4+m5+m16+m17+m21+m25+m29

Answer:-

F = + + + +

Distinguish between a gate and a circuit.


Draw a circuit diagram corresponding to the following Boolean expression:
(A + B)(B + C)
Draw a circuit diagram corresponding to the following Boolean expression:
(AB + C)D

Distinguish between a gate and a circuit:-


Gate:-
A gate accepts one or more input signals and produces an output signal. Each
type of gate performs one logical function.
Circuit:-
A circuit is a combination of gates designed to accomplish a more complex
logical function.

Circuit Diagram:-
(A + B)(B + C)

Second Assignment | Digital and Logic Design


Page 10 of 16

Circuit Diagram:-
(AB + C)D

Show the behavior of the following circuit with a truth table:


A

Show the behavior of the following circuit with a truth table:


A

First Figure Truth Table:-

A B A.B A+B (A . B) + (A + B)
0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 1

Second Figure Truth Table:-

A B
.
+ (
. ) + (
. )

0 0 1 0 1 0
0 1 1 1 1 0
1 0 0 0 0 1
1 1 0 0 0 1

Question No.4
Explain why which of the following is DIGITAL & which is ANALOG?
a) Pressure in a bikes tire b) Temperature
c) Speed of a car d) Number of students in a class
Second Assignment | Digital and Logic Design
Page 11 of 16

Draw the logic symbol and construct the truth table for each of the following gates.

a) Two input NAND gate b)Three input OR gate


c) NOT gate d)Three input EX-NOR gate
Explain the following Elements of Digital Logic Design.

a) Counter b) Multiplexer c) DE multiplexer d) Shift Register

Explain why which of the following is DIGITAL & which is ANALOG?


a) Pressure in a bikes tire b) Temperature
c) Speed of a car d) Number of students in a class

Pressure in a Bikes Tire, Temperature, and Speed of a Car:-

The three types are voltage because analog signal is a continuous signal or
form of wave. It does not increase or decrease rapidly. Light, sound air is type of
analog.

Number of students in a class:-

The number of students in a class is type of digital because digital signal is a


sequence of voltage represents in a binary form. The digital signal or the form of
pulses of ON and OFF. The student of a class represent in a sequence mean 0 and 1
form.

Draw the logic symbol and construct the truth table for each of the following gates.

b) Two input NAND gate b)Three input OR gate


c) NOT gate d)Three input EX-NOR gate

3-input Logic NAND Gate:-

Symbol Truth Table

C B A Q

0 0 0 1

0 0 1 1

0 1 0 1

3-input NAND Gate 0 1 1 1

1 0 0 1

1 0 1 1

Second Assignment | Digital and Logic Design


Page 12 of 16

1 1 0 1

1 1 1 0

3-input OR Gate:-

Symbol Truth Table

C B A Q

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 1

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1

NOT Gate:-

3-input Ex-NOR Gate:-

Symbol Truth Table

C B A Q

0 0 0 1

3-input Ex-NOR Gate 0 0 1 0

Second Assignment | Digital and Logic Design


Page 13 of 16

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 0

Explain the following Elements of Digital Logic Design.

a) Counter b) Multiplexer c) DE multiplexer d) Shift Register

Counter:-
Counter is a sequential circuit. A digital circuit which is used for counting
pulses is known counter. Counter is the widest application of flip-flops. It is a group
of flip-flops with a clock signal applied.
Counters are of two types.
1. Asynchronous or ripple counters.
2. Synchronous counters.

Asynchronous or Ripple Counters:-


The logic diagram of a 2-bit ripple up counter is shown in figure. The toggle
(T) flip-flop is being used. But we can use the JK flip-flop also with J and K
connected permanently to logic 1. External clock is applied to the clock input of flip-
flop A and QA output is applied to the clock input of the next flip-flop i.e. FF-B.
Synchronous counters:-
If the "clock" pulses are applied to all the flip-flops in a counter
simultaneously, then such a counter is called as synchronous counter.
2-Bit Synchronous Up Counter:-
The JA and KA inputs of FF-A are tied to logic 1. So FF-A will work as a
toggle flip-flop. The JB and KB inputs are connected to QA.

Multiplexer:-
In electronics, a multiplexer (or mux) is a device that selects one of
several analog or digital input signals and forwards the selected input into a single
line. A multiplexer of 2n inputs has n select lines, which are used to select which input
line to send to the output. Multiplexers are mainly used to increase the amount of data
that can be sent over the network within a certain amount of time and bandwidth. A
multiplexer is also called a data selector. Multiplexers can also be used to implement
Boolean functions of multiple variables.

Second Assignment | Digital and Logic Design


Page 14 of 16

De-multiplexer:-
Conversely, a demultiplexer (or demux) is a device taking a single input
signal and selecting one of many data-output-lines, which is connected to the single
input. A multiplexer is often used with a complementary demultiplexer on the
receiving end.
Demultiplexer is used to connect a single source to multiple destinations. The
main application area of demultiplexer is communication system where multiplexer
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.

Shift register:-
The Shift Register is another type of sequential logic circuit that can be used
for the storage or the transfer of data in the form of binary numbers. This sequential
device loads the data present on its inputs and then moves or shifts it to its output
once every clock cycle, hence the name Shift Register.
A shift register basically consists of several single bit D-Type Data Latches,
one for each data bit, either a logic 0 or a 1, connected together in a serial type
daisy-chain arrangement so that the output from one data latch becomes the input of
the next latch and so on.
Shift Registers are used for data storage or for the movement of data and are
therefore commonly used inside calculators or computers to store data such as two
binary numbers before they are added together.

Question No.5
1. What are universal gates? Construct a logic circuit using NAND gates only for the
expression x = A. (B + C).
2. Draw the logic diagram for the given expression

3. Find the Boolean expression for the logic circuit show below:$

Construct the truth table of the following logic circuit figure a, and figure b.

4. Construct the truth table of the following logic circuit figure a, and figure b.

Second Assignment | Digital and Logic Design


Page 15 of 16

Figure a Figure b

What are universal gates? Construct a logic circuit using NAND gates only for the
expression x = A. (B + C).

Universal Gates:-
A universal gate is a gate which can implement any Boolean function without
need to use any other gate type. The NAND and NOR gates are universal gates.
Logic Circuit Using NAND Gates:-

Draw the logic diagram for the given expression?

Logic Diagram of Given Expression:-

Second Assignment | Digital and Logic Design


Page 16 of 16

Find the Boolean expression for the logic circuit show below:

Boolean Expression For Logic Circuit:-

.
( ) + ( +
) =

Construct the truth table of the following logic circuit figure a, and figure b.?

Figure a Figure b

Figure (A) Truth Table:-

A B A+B
+
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0

Figure (B) Truth Table:-

A B

.

0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 0 0 0

Second Assignment | Digital and Logic Design

You might also like