DECO Lab File
DECO Lab File
3rd Semester,
July-December 2020
By
Faculty: ……………..
……………. ………………
……………….
1
INDEX
S.N Category of Cod Experimen Name of Date of Date of Max. Marks Signatur
o Assignment e t No. Experiment Allotment Evaluatio obtaine e of
Mark
of n d Faculty
s
experimen
t
2
Experiment COMMON BUS
USING
MULTIPLEXER.
3
Experiment – 1
Objective To interpret, implement and verify the logic and truth table for AND, OR, NOT, NAND,
NOR, Ex-OR, Ex-NOR.
Theory:
Logic gates are the basic building blocks of any digital system. Logic gates are electronic circuits having
one or more than one input and only one output. The relationship between the input and the output is
based on certain logic. Based on this, logic gates are named as
1) AND gate
2) OR gate
3) NOT gate
4) NAND gate
5) NOR gate
6) Ex-OR gate
7) Ex-NOR gate
1) AND gate
The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are high. A dot (.) is
used to show the AND operation i.e. A.B or can be written as AB
Y= A.B
4
Figure-2:Truth Table of AND Gate
2) OR gate
The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high. A
plus (+) is used to show the OR operation.
Y= A+B
5
3) NOT gate
The NOT gate is an electronic circuit that produces an inverted version of the input at its output. It is also
known as an inverter. If the input variable is A, the inverted output is known as NOT A. This is also
shown as A' or A with a bar over the top, as shown at the outputs.
Y= A'
4) NAND gate
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The outputs of all
NAND gates are high if any of the inputs are low. The symbol is an AND gate with a small circle on the
output. The small circle represents inversion.
Y= AB
6
Figure-10:Logic Symbol of NAND Gate
5) NOR gate
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR
gates are low if any of the inputs are high. The symbol is an OR gate with a small circle on the output.
The small circle represents inversion.
Y= A+B
7
Figure-14:Truth Table of NOR gate
6) Ex-OR gate
The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not both of its two inputs
are high. An encircled plus sign (⊕) is used to show the Ex-OR operation.
Y= A⊕B
8
7) Ex-NOR gate
The 'Exclusive-NOR' gate circuit does the opposite to the EX-OR gate. It will give a low output if either,
but not both of its two inputs are high. The symbol is an EX-OR gate with a small circle on the output.
The small circle represents inversion.
Y= A⊕B
Implementation:
OR, AND and NOT Gates:
9
10
NAND and NOR Gates:
11
Ex OR and Ex NOR Gates:
12
13
Result:
OR, AND and NOR Gates:
14
Ex OR and Ex NOR Gates:
15
Conclusion Hence, we interpret, implement and verify the logic and truth table for AND, OR,
NOT, NAND, NOR, Ex-OR, Ex-NOR.
Precautions:
1. Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible
Concept (A) 2
Implementation (B) 2
Performance (C) 2
16
Experiment – 2
Objective To simulate and verify Half Adder circuit using NAND and NOR gates.
Software Used – Circuit Verse and Virtual Lab.
Theory:
Adders are digital circuits that carry out addition of numbers. Adders are a key component of arithmetic
logic unit. Adders can be constructed for most of the numerical representations like Binary Coded
Decimal (BDC), Excess – 3, Gray code, Binary etc. out of these, binary addition is the most frequently
performed task by most common adders. Apart from addition, adders are also used in certain digital
applications like table index calculation, address decoding etc.
Binary addition is similar to that of decimal addition. Some basic binary additions are shown below.
Half Adder
Half adder is a combinational circuit that performs simple addition of two binary numbers. The block
diagram of a half adder is shown below.
If we assume A and B as the two bits whose addition is to be performed, a truth table for half adder with
A, B as inputs and Sum, Carry as outputs can be tabulated as follows.
The sum output of the binary addition carried out above is similar to that of an Ex-OR operation while the
carry output is similar to that of an AND operation. The same can be verified with help of Karnaugh Map.
17
The truth table and K Map simplification for sum output is shown below.
18
The truth table and K Map simplification for carry is shown below.
Carry = AB
19
If A and B are binary inputs to the half adder, then the logic function to calculate sum S is Ex – OR of A
and B and logic function to calculate carry C is AND of A and B. Combining these two, the logical circuit
to implement the combinational circuit of half adder is shown below.
Five NAND gates are required in order to design a half adder. The circuit to realize half adder using
NAND gates is shown below.
20
Five NOR gates are required in order to design a half adder. The circuit to realize half adder using NOR
gates is shown below.
Implementation:
Half Adder:
21
Half Adder Using NAND Gate:
22
23
Half Adder Using NOR Gate:
24
Result:
Half Adder:
25
Half Adder Using NAND Gate:
26
Conclusion Hence, we simulate and verify Half Adder circuit using NAND and NOR gates.
Precautions:
1. Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible
Concept (A) 2
Implementation (B) 2
Performance (C) 2
27
Experiment – 3
Objective To simulate and verify Full Adder Circuit using gates and half adder.
Software Used – Circuit Verse and Virtual Labs.
Theory:
Adders are digital circuits that carry out addition of numbers. Adders are a key component of arithmetic
logic unit. Adders can be constructed for most of the numerical representations like Binary Coded
Decimal (BDC), Excess – 3, Gray code, Binary etc. out of these, binary addition is the most frequently
performed task by most common adders. Apart from addition, adders are also used in certain digital
applications like table index calculation, address decoding etc
Full Adder
Full adder is a digital circuit used to calculate the sum of three binary bits which is the main difference
between full adder and half adder. Full adders are complex and difficult to implement when compared to
half adders. Two of the three bits are same as before which are A, the augend bit and B, the addend bit.
The additional third bit is carry bit from the previous stage and is called 'Carry' – in generally represented
by CIN. It calculates the sum of three bits along with the carry. The output carry is called Carry – out and
is represented by COUT.
The block diagram of a full adder with A, B and CIN as inputs and S, COUT as outputs is shown below.
Full Adder Block Diagram and Truth Table
28
Based on the truth table, the Boolean functions for Sum (S) and Carry – out (COUT) can be derived using
K – Map.
The simplified equation for sum is S = A'B'Cin + A'BCin' + ABCin
The simplified equation for COUT is COUT = AB + ACIN + BCIN
In order to implement a combinational circuit for full adder, it is clear from the equations derived above,
that we need four 3-input AND gates and one 4-input OR gates for Sum and three 2-input AND gates and
one 3-input OR gate for Carry – out.
As mentioned earlier, a NAND gate is one of the universal gates and can be used to implement any logic
design. The circuit of full adder using only NAND gates is shown below.
29
Full Adder using NAND gates
As mentioned earlier, a NOR gate is one of the universal gates and can be used to implement any logic
design. The circuit of full adder using only NOR gates is shown below.
Implementation:
Full Adder:
30
31
32
Full Adder Using Half Adder:
33
34
35
Result:
Full Adder:
36
Full Adder Using Half Adder:
37
Conclusion Hence, we simulate and verify Full Adder Circuit using gates and half adder.
Precautions:
1. Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible
Concept (A) 2
Implementation (B) 2
38
Performance (C) 2
39
Experiment 4
Theory:
Introduction
Inside a computer, there is an Arithmetic Logic Unit (ALU), which is capable of performing
logical operations (e.g. AND, OR, Ex-OR, Invert etc.) in addition to the arithmetic operations
(e.g. Addition, Subtraction etc.). The control unit supplies the data required by the ALU from
memory, or from input devices, and directs the ALU to perform a specific operation based on the
instruction fetched from the memory. ALU is the “calculator” portion of the computer.
Fig 1. ALU
An arithmetic logic unit(ALU) is a major component of the central processing unit of the a
computer system. It does all processes related to arithmetic and logic operations that need to be
done on instruction words. In some microprocessor architectures, the ALU is divided into the
arithmetic unit (AU) and the logic unit (LU).
An ALU can be designed by engineers to calculate many different operations. When the
operations become more and more complex, then the ALU will also become more and more
expensive and also takes up more space in the CPU and dissipates more heat. That is why
engineers make the ALU powerful enough to ensure that the CPU is also powerful and fast, but
not so complex as to become prohibitive in terms of cost and other disadvantages.
40
ALU is also known as an Integer Unit (IU). 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.
Different operation as carried out by ALU can be categorized as follows –
logical operations − These include operations like 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 either towards the right or left, which is considered a multiplication or
division operations.
Arithmetic operations − This refers to bit addition and subtraction. Although
multiplication and division are sometimes used, these operations are more expensive to
41
make. Multiplication and subtraction can also be done by repetitive additions and
subtractions, respectively.
Circuit Implementation:
42
Result:
Conclusion:
Hence, we can simulate the logical part of a simple Arithmetic logical Unit.
Precautions:
1. Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
43
Experiment 5
Theory:
Introduction
In Digital Circuits, A Binary Adder-Subtractor is one which is capable of both addition and
subtraction of binary numbers in one circuit itself. The operation being performed depends upon
the binary value the control signal holds. It is one of the components of the ALU (Arithmetic
Logic Unit).
This Circuit Requires prerequisite knowledge of Exor Gate, Binary Addition and Subtraction,
Full Adder.
Lets consider two 4-bit binary numbers A and B as inputs to the Digital Circuit for the operation
with digits
A0 A1 A2 A3 for A
B0 B1 B2 B3 for B
The circuit consists of 4 full adders since we are performing operation on 4-bit numbers. There is
a control line K that holds a binary value of either 0 or 1 which determines that the operation
being carried out is addition or subtraction.
44
As shown in the figure, the first full adder has control line directly as its input(input carry C0),
The input A0 (The least significant bit of A) is directly input in the full adder. The third input is
the exor of B0 and K (S in fig But do not confuse it with Sum-S). The two outputs produced are
Sum/Difference (S0) and Carry (C1).
If the value of K (Control line) is 1, th output of B0(exor)K=B0′(Complement B0). Thus the
operation would be A+(B0′). Now 2’s complement subtraction for two numbers A and B is given
by A+B’. This suggests that when K=1, the operation being performed on the four bit numbers is
subtraction.
Similarly If the Value of K=0, B0 (exor) K=B0. The operation is A+B which is simple binary
addition. This suggests that When K=0, the operation being performed on the four bit numbers is
addition.
Then C0 is serially passed to the second full adder as one of it’s outputs. The sum/difference S0
is recorded as the least significant bit of the sum/difference. A1, A2, A3 are direct inputs to the
second, third and fourth full adders. Then the third input is the B1, B2, B3 EXORed with K to
the second, third and fourth full adder respectively. The carry C1, C2 are serially passed to the
successive full adder as one of the inputs. C3 becomes the total carry to the sum/difference. S1,
S2, S3 are recorded to form the result with S0.
Circuit Implementation:
45
Result:
Conclusion:
Hence, we can simulate 4-bit binary adder-subtractor circuit.
Precautions:
1.Make sure that the circuit is connected properly.
46
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
47
Experiment 6
Theory:
Introduction
BCD stand for binary coded decimal. Suppose we have two 4-bit numbers A and B. The value of A and B
can vary from 0(0000 in binary) to 9(1001 in binary) because we are considering decimal numbers.
48
Fig 2. Truth table of BCD Adder
We are adding “0110” (=6) only to the second half of the table.
The conditions are:
1. If C’ = 1 (Satisfies 16-19)
2. If S3′. S2′ = 1 (Satisfies 12-15)
3. If S3′. S1′ = 1 (Satisfies 10 and 11)
So, our logic is
C' + S3'. S2' + S3'.S1' = 1
Implementation:
49
Circuit Implementation:
Result:
50
Conclusion:
Hence, we can simulate one-digit BCD adder.
Precautions:
1.Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
51
Experiment 7
Theory:
Introduction
As well as the standard Digital Buffer seen above, there is another type of digital buffer circuit whose
output can be “electronically” disconnected from its output circuitry when required. This type of Buffer is
known as a 3-State Buffer or more commonly a Tri-state Buffer.
A Tri-state Buffer can be thought of as an input controlled switch with an output that can be electronically
turned “ON” or “OFF” by means of an external “Control” or “Enable” ( EN ) signal input. This control
signal can be either a logic “0” or a logic “1” type signal resulting in the Tri-state Buffer being in one
state allowing its output to operate normally producing the required output or in another state were its
output is blocked or disconnected.
Then a tri-state buffer requires two inputs. One being the data input and the other being the enable or
control input as shown.
When activated into its third state it disables or turns “OFF” its output producing an open circuit
condition that is neither at a logic “HIGH” or “LOW”, but instead gives an output state of very high
impedance, High-Z, or more commonly Hi-Z. Then this type of device has two logic state inputs, “0” or a
“1” but can produce three different output states, “0”, “1” or ” Hi-Z ” which is why it is called a “Tri” or
“3-state” device.
52
Note that this third state is NOT equal to a logic level “0” or “1”, but is an high impedance state in which
the buffers output is electrically disconnected from the rest of the circuit. As a result, no current is drawn
from the supply.
There are four different types of Tri-state Buffer, one set whose output is enabled or disabled by an
“Active-HIGH” control signal producing an inverted or non-inverted output, and another set whose buffer
output is controlled by an “Active-LOW” control signal producing an inverted or non-inverted output as
shown below.
Circuit Implementation:
53
Result:
Conclusion:
Hence, we can simulate the tristate buffer.
Precautions:
1.Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
54
Experiment 8
Objective: To simulate the common bus using tri-state buffers and decoder.
Theory:
Introduction
A bus system can be constructed with three-state gates instead of multiplexers. A three-state gate is a
digital circuit that exhibits three states. Two of the states are signals equivalent to logic 1 and 0 as in a
conventional gate. The third state is a high-impedance state. The high-impedance state behaves like an
open circuit, which means that the output is disconnected and does not have a logic significance. Three-
state gates may perform any conventional logic, such as AND or NAND. However, the one most used in
the design of a bus system is the buffer gate.
The graphic symbol of a three-state buffer gate is shown in fig. It is distinguished from a normal buffer
by having both a normal input and a control input. The control input determines the output state. When
the control input is equal to 1, the output is enabled and the gate behaves like any conventional buffer,
with the output equal to the normal input. When the control input is 0, the output is disabled and the gate
goes to a high-impedance state, regardless of the value in the normal input. The high-impedance state of
a three-state gate provides a special feature not available in other gates. Because of this feature, a large
number of three-state gate outputs can be connected with wires to form a common bus line without
endangering loading effects.
55
The construction of a bus system with three-state buffers is demonstrated in Fig. The outputs of four
buffers are connected to form a single bus line. (It must be realized that this type of connection cannot be
done with gates that do not have three-state outputs.) The control inputs to the buffers determine which
of the four normal inputs will communicate with the bus line. No more than one buffer may be in the
active state at any given time. The connected buffers must be controlled so that only one three-state
buffer has access to the bus line while all other buffers are maintained in a high impedance state.
One way to ensure that no more than one control input is active at any given time is to use a decoder, as
shown in the diagram. When the enable input of the decoder is 0, all its four outputs are 0, and the bus
line is in a high-impedance state because all four buffers are disabled. When the enable input is active,
one of the three-state buffers will be active, depending on the binary value in the select inputs of the
decoder. Careful investigation will reveal that Fig. is another way of constructing a 4 x 1 multiplexer
Circuit Implementation:
Result:
56
Conclusion:
Hence, we can simulate common bus using tristate buffer and decoder.
Precautions:
1.Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
Experiment 9
57
Objective: To simulate the common bus using tri-state buffers and decoder.
Theory:
Introduction
A typical computer has many registers and we need to transfer the information between
these registers. A way to transfer the information is using the common bus system. In
this article we shall discuss the common bus system using multiplexers.
58
SELECT LINES COMBINATION S1S0 REGISTER SELECTED
00 Register A
01 Register B
10 Register C
11 Register D
As we can see that when S1S0=00, register A is selected because on 00 the 0 data
inputs of all the multiplexers are applied to the common bus.
Since the 0 data inputs of all the multiplexers receive the inputs from the register A, thus
register A gets selected. Similarly, for other combinations of S1S0 other register are
selected.
No. of multiplexers needed = No. of bits in each register
Circuit Implementation:
D FLIP FLOP:
59
Result:
D FLIP FLOP:
60
Conclusion:
Hence, we can simulate common bus using tristate buffer and decoder.
Precautions:
1.Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
61
Experiment 10
Theory
8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor
designed by Intel in 1977 using NMOS technology.
It has the following configuration −
62
that the program counter points to the memory address of the next instruction that is going to be
executed.
Stack pointer
It is also a 16-bit register works like stack, which is always incremented/decremented by 2
during push & pop operations.
Temporary register
It is an 8-bit register, which holds the temporary data of arithmetic and logical operations.
Flag register
It is an 8-bit register having five 1-bit flip-flops, which holds either 0 or 1 depending upon the
result stored in the accumulator.
These are the set of 5 flip-flops −
Sign (S)
Zero (Z)
Auxiliary Carry (AC)
Parity (P)
Carry (C)
Its bit position is shown in the following table −
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
63
Interrupt control
As the name suggests it controls the interrupts during a process. When a microprocessor is
executing a main program and whenever an interrupt occurs, the microprocessor shifts the
control from the main program to process the incoming request. After the request is completed,
the control goes back to the main program.
There are 5 interrupt signals in 8085 microprocessors: INTR, RST 7.5, RST 6.5, RST 5.5,
TRAP.
Serial Input/output control
It controls the serial data communication by using these two instructions: SID (Serial input
data) and SOD (Serial output data).
Address buffer and address-data buffer
The content stored in the stack pointer and program counter is loaded into the address buffer
and address-data buffer to communicate with the CPU. The memory and I/O chips are
connected to these buses; the CPU can exchange the desired data with the memory and I/O
chips.
Address bus and data bus
Data bus carries the data to be stored. It is bidirectional, whereas address bus carries the location
to where it should be stored, and it is unidirectional. It is used to transfer the data & Address I/O
devices.
8085 Architecture
We have tried to depict the architecture of 8085 with this following image −
64
Pin Configuration of 8085 Microprocessor
The following image depicts the pin diagram of 8085 Microprocessor −
65
RD − This signal indicates that the selected IO or memory device is to be read and is
ready for accepting data available on the data bus.
WR − This signal indicates that the data on the data bus is to be written into a selected
memory or IO location.
ALE − It is a positive going pulse generated when a new operation is started by the
microprocessor. When the pulse goes high, it indicates address. When the pulse goes
down it indicates data.
Three status signals are IO/M, S0 & S1.
IO/M
This signal is used to differentiate between IO and Memory operations, i.e. when it is high
indicates IO operation and when it is low then it indicates memory operation.
S1 & S0
These signals are used to identify the type of current operation.
Power supply
There are 2 power supply signals − VCC & VSS. VCC indicates +5v power supply and VSS
indicates ground signal.
Clock signals
There are 3 clock signals, i.e. X1, X2, CLK OUT.
X1, X2 − A crystal (RC, LC N/W) is connected at these two pins and is used to set
frequency of the internal clock generator. This frequency is internally divided by 2.
CLK OUT − This signal is used as the system clock for devices connected with the
microprocessor.
Interrupts & externally initiated signals
Interrupts are the signals generated by external devices to request the microprocessor to perform
a task. There are 5 interrupt signals, i.e. TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR. We will
discuss interrupts in detail in interrupts section.
INTA − It is an interrupt acknowledgment signal.
RESET IN − This signal is used to reset the microprocessor by setting the program
counter to zero.
RESET OUT − This signal is used to reset all the connected devices when the
microprocessor is reset.
66
READY − This signal indicates that the device is ready to send or receive data. If
READY is low, then the CPU has to wait for READY to go high.
HOLD − This signal indicates that another master is requesting the use of the address
and data buses.
HLDA (HOLD Acknowledge) − It indicates that the CPU has received the HOLD
request and it will relinquish the bus in the next clock cycle. HLDA is set to low after the
HOLD signal is removed.
Serial I/O signals
There are 2 serial signals, i.e. SID and SOD and these signals are used for serial communication.
SOD (Serial output data line) − The output SOD is set/reset as specified by the SIM
instruction.
SID (Serial input data line) − The data on this line is loaded into accumulator whenever a
RIM instruction is executed.
Conclusion:
Hence, we study 8085 microprocessors.
Precautions:
Criteria Total Marks Marks Obtained Comments
Concept (A) 2
Implementation (B) 2
Performance (C) 2
67
68
Experiment 11
Theory
Instruction sets are instruction codes to perform some task. It is classified into five categories.
1 Control Instructions
2 Logical Instructions
3 Branching Instructions
4 Arithmetic Instructions
5 Data Transfer Instructions
Control Instructions
Following is the table showing the list of Control instructions with their meanings.
RIM None Read interrupt This instruction is used to read the status of
mask interrupts 7.5, 6.5, 5.5 and read serial data input
69
bit.
Logical Instructions
The following table shows the list of Logical instructions with their meanings.
70
memory, and result is placed in the
M accumulator
accumulator.
Branching instructions
71
The following table shows the list of Branching instructions with their meanings.
Jump on
JC CY=1
Carry
Jump on no
JNC CY=0
Carry
Jump on
JP S=0
positive
The program sequence is
16-bit Jump transferred to the memory
Jump on
JM S=1 addres conditionall address given in the operand
minus
s y based on the specified flag of
the PSW.
Jump on
JZ Z=1
zero
Jump on no
JNZ Z=0
zero
Jump on
JPE P=1
parity even
Jump on
JPO P=0
parity odd
72
Status
Call on
CC CY=1
Carry
Call on no
CNC CY=0
Carry
Call on
CP S=0
positive
address given in the operand.
Call on subroutine Before transferring, the address
CM S=1 s
minus call of the next instruction after
CALL is pushed onto the stack.
CZ Call on zero Z=1
Call on no
CNZ Z=0
zero
Call on
CPE P=1
parity even
Call on
CPO P=0
parity odd
73
Return on
RNC CY=0
no Carry
Return on
RP S=0
positive
Return on
RM S=1
minus
Return on
RZ Z=1
zero
Return on
RNZ Z=0
no zero
Return on
RPE P=1
parity even
Return on
RPO P=0
parity odd
RST 0 0000H
74
RST 1 0008H
RST 2 0010H
RST 3 0018H
RST 4 0020H
RST 5 0028H
RST 6 0030H
RST 7 0038H
TRAP 0024H
Arithmetic instructions
Following is the table showing the list of Arithmetic instructions with their meanings.
75
The contents of the register or memory
Add register or are added to the contents of the
R
ADD memory, to the accumulator and the result is stored in
M accumulator the accumulator.
Example − ADD K.
76
result is stored in the accumulator.
Example − SUB K
77
The contents of the designated register
Decrement the register pair are decremented by 1 and their
DCX R result is stored at the same place.
pair by 1
Example − DCX K
Data-transfer instructions
Following is the table showing the list of Data-transfer instructions with their meanings.
Opcod
Operand Meaning Explanation
e
LDA 16-bit address Load the accumulator The contents of a memory location,
specified by a 16-bit address in the
78
operand, are copied to the accumulator.
Example − LDA 2034K
79
The contents of register L are stored in
the memory location specified by the
16-bit address in the operand and the
contents of H register are stored into the
next memory location by incrementing
Store H and L registers the operand.
SHLD 16-bit address
direct
This is a 3-byte instruction, the second
byte specifies the low-order address and
the third byte specifies the high-order
address.
Example − SHLD 3225K
PUSH Reg. pair Push the register pair The contents of the register pair
onto the stack designated in the operand are copied
80
onto the stack in the following
sequence.
The stack pointer register is
decremented and the contents of the
high order register (B, D, H, A) are
copied into that location.
The stack pointer register is
decremented again and the contents of
the low-order register (C, E, L, flags)
are copied to that location.
Example − PUSH K
Conclusion:
81
Hence, we study instruction set of 8085 microprocessors.
Precautions:
1.Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
82
Experiment 12
Theory:
Introduction
Subtractor circuits take two binary numbers as input and subtract one binary number input from the other
binary number input. Like adders, it gives out two outputs, difference and borrow (carry-in the case of
Adder). There are two types of subtractors.
1) Half Subtractor
2) Full Subtractor
1) Half Subtractor
The half-subtractor is a combinational circuit which is used to perform subtraction of two bits. It has two
inputs, X (minuend) and Y (subtrahend) and two outputs D (difference) and B (borrow). The logic
symbol and truth table are shown below.
83
Figure-3: Circuit Diagram of Half subtractor
From the above truth table, we can find the Boolean expression.
D=X⊕Y
B = X' Y
From the equation we can draw the half-subtractor circuit as shown in the figure 3.
2) Full Subtractor
A full subtractor is a combinational circuit that performs subtraction involving three bits, namely
minuend, subtrahend, and borrow-in . It accepts three inputs: minuend, subtrahend and a borrow bit and it
produces two outputs: difference and borrow. The logic symbol and truth table are shown below.
84
From the above truth table, we can find the Boolean expression .
D = A ⊕ B ⊕ Bin
B = A' Bin + A' B + B Bin
From the equation we can draw the Full-subtractor circuit as shown in the figure 6.
Circuit Implementation:
1) Half Subtractor:
85
2) Full Subtractor:
Result:
86
1) Half Subtractor:
2) Full Subtractor:
Conclusion:
Hence, we can simulate Half and Full Subtractor.
Precautions:
1. Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
87
Criteria Total Marks Marks Obtained Comments
Concept (A) 2
Implementation (B) 2
Performance (C) 2
88
Experiment 13
Theory:
Introduction
An Encoder is a combinational circuit that performs the reverse operation of Decoder. It has
maximum of 2^n input lines and ‘n’ output lines, hence it encodes the information from 2^n
inputs into an n-bit code. It will produce a binary code equivalent to the input, which is active
High. Therefore, the encoder encodes 2^n input lines with ‘n’ bits.
The 8 to 3 Encoder or octal to Binary encoder consists of 8 inputs : Y7 to Y0 and 3 outputs :
A2, A1 & A0. Each input line corresponds to each octal digit and three outputs generate
corresponding binary code.
The figure below shows the logic symbol of octal to binary encoder:
89
Logical expression for A2, A1 and A0:
A2 = Y7 + Y6 + Y5 + Y4
A1 = Y7 + Y6 + Y3 + Y2
A0 = Y7 + Y5 + Y3 + Y1
The above two Boolean functions A2, A1 and A0 can be implemented using four input OR
gates :
Priority encoders are available in standard IC form and the TTL 74LS148 is an 8-to-3 bit priority
encoder which has eight active LOW (logic “0”) inputs and provides a 3-bit code of the highest
ranked input at its output.
Priority encoders output the highest order input first for example, if input lines “D2“, “D3” and
“D5” are applied simultaneously the output code would be for input “D5” (“101”) as this has the
highest order out of the 3 inputs. Once input “D5” had been removed the next highest output
code would be for input “D3” (“011”), and so on.
The truth table for a 8-to-3 bit priority encoder is given as:
90
Digital Inputs Binary Output
D7 D6 D5 D4 D3 D2 D1 D0 Q2 Q1 Q0
0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 1 X 0 0 1
0 0 0 0 0 1 X X 0 1 0
0 0 0 0 1 X X X 0 1 1
0 0 0 1 X X X X 1 0 0
0 0 1 X X X X X 1 0 1
0 1 X X X X X X 1 1 0
1 X X X X X X X 1 1 1
91
Output Q0
Output Q1
Output Q2
Then the final Boolean expression for the priority encoder including the zero inputs is defined as:
Circuit Implementation:
8:3 Encoder:
92
8:3 Priority Encoder using two 4:2 priority encoders
Result:
8:3 Encoder
93
Conclusion:
Hence, we can simulate 8:3 encoder and 8:3 priority encoder.
Precautions:
1.Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
94
Experiment 14
Theory:
A comparator used to compare two bits is called a single bit comparator. It consists of two
inputs each for two single bit numbers and three outputs to generate less than, equal to and
greater than between two binary numbers.
From the above truth table logical expressions for each output can be expressed as follows:
A>B: AB'
95
A<B: A'B
A=B: A'B' + AB
By using these Boolean expressions, we can implement a logic circuit for this comparator
as given below:
A comparator used to compare two binary numbers each of two bits is called a 2-bit Magnitude
comparator. It consists of four inputs and three outputs to generate less than, equal to and
greater than between two binary numbers.
96
From the above truth table K-map for each output can be drawn as follows:
97
From the above K-maps logical expressions for each output can be expressed as follows:
By using these Boolean expressions, we can implement a logic circuit for this comparator as
given below:
Circuit Implementation:
98
1-Bit Comparator
99
Result:
1-Bit comparator
Conclusion:
Hence, we can simulate 1-bit and 2-bit comparators.
100
Precautions:
1.Make sure that the circuit is connected properly.
2. Use flags wherever necessary.
3. Test the circuit for as many inputs as possible.
Concept (A) 2
Implementation (B) 2
Performance (C) 2
101