Computer Organization Lab 17012013
Computer Organization Lab 17012013
Theory:
INPUT OUTPUT
A B
0 0 1
0 1 1
1 0 1
1 1 0
+5V
Ground
7400
Theory:
A Half-Adder
As a first example of useful combinational logic, let's build a device that can add two binary digits together.
We can quickly calculate what the answers should be:
Simplifying boolean equations or making some Karnaugh map will produce the same circuit shown below,
but start by looking at the results. The Sum column is our familiar XOR gate, while the Cout column is the
AND gate. This device is called a half-adder for reasons that will make sense in the next section.
A Full-Adder:
The half-adder is extremely useful until you want to add more that one binary digit quantities. The slow
way to develop a two- binary digit adder would be to make a truth table and reduce it. Then when you
decide to make a three binary digit adder, do it again. Then when you decide to make a four-digit adder, do
it again. Then when ... The circuits would be fast, but development time would be slow.
Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.
11
11
---
110
Look at how many inputs the middle column uses. Our adder needs three inputs; a, b, and the carry from
the previous sum, and we can use our two-input adder to build a three input adder.
Σ is the easy part. Normal arithmetic tells us that if Σ = a + b + Cin and Σ1 = a + b, then Σ = Σ1 + Cin.
In order to calculate the high order bit, notice that it is 1 in both cases when a + b produces a C1. Also, the
high order bit is 1 when a + b produces a Sum and Cin is a 1. So we will have a carry when C1 OR (Sum
AND Cin). Our complete three input adder is:
For some designs, being able to eliminate one or more types of gates can be important, and you can
replace the final OR gate with an XOR gate without changing the results.
A Half-Subtractor:
A half subtractor is a combinational circuit that subtracts two bits and produces their difference. It also has
an o/p to specify if a1 has been borrowed. Designate the minuend bit by X and the subtrahend bit by Y.
to perform X-Y we have three possibilities 0-0=0,1-0=1,0-1=1,1-1=0.the half subtractor needs two o/p’s.
One o/p generates the difference and will be designed by the symbol D. The second o/p designated by B
for borrow, generates the binary signal that informs the next stage that 1 has been borrowed.
TRUTH TABLE: -
INPUT OUTPUT
X Y Difference Borrow
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
A Full- Subtractor:
A Full Subtractor is a combinational circuit that performs a subtraction between two bits; taking into
account that a1 may have been borrowed by a lower significant stage. This circuit has two inputs and two
outputs. The three inputs, Y and Z, denotes the minuend, subtrahend and previous borrow respectively.
The two outputs and B represents the difference and output borrow respectively.
Difference= X’Y’Z+X’YZ’+XY’Z’+XYZ
Borrow = X’Y+YZ+ZX’
TRUTH TABLE: -
INPUT OUTPUT
X Y Z Difference Borrow
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
RESULT:- The operation of half adder, half subtractor, full adder, full subtractor has been verified.
PRECAUTIONS: -
1. Connection should be tight.
2. O/P should be finding sequentially.
3. IC’s should be handled carefully.
Experiment 3
Object: Bread Board Implementation of binary adder- subtractor for 4- bits.
Theory:
The addition and subtraction operation can be combined into one common circuit by
including an X- OR gate with each Full adder. The mode input M controls the operation. When M=0 the
circuit is an Adder and when M=1 the circuit becomes subtractor. Each X- OR gate receives input M and
one of the inputs of B. When M=0, we have B ⊕ 0= B. The full adders receive the value of B, the input
carry is 0, and the circuit performs A plus B. When M=1, we have B ⊕ 1= B’ and C1=1. The B inputs are
all complemented and a 1 is added through the input carry. The circuit performs the operation A plus the
2’s complement of B. For unsigned numbers, this gives A-B if A>= B or the 2’s complement of (B-A) if
A<B. For signed numbers, the result is A- B provided that there is no overflow.
A 4-bit Adder-Subtractor is shown in fig.1. Addition operation is done with SUB input kept LOW.
When SUB input is LOW, the output is the same as that of the addend. Hence
Augend A3 A2 A1 A0
Addend B3 B2 B1 B0
Sum S3 S2 S1 S0
and carry output Cout.
Subtraction operation is done by using 2’scomplement. For subtraction, SUB input is kept HIGH.
When SUB input is HIGH, the output is the complement of the input (i.e. B3, B2, B1, B0). If a 1 is added to
the 1’s complement of this input, we get 2’s complement of the data input. Now subtraction can be done
by 2’s complement method by adding the addend and subtrahend. Hence
Addend B3 B2 B1 B0
1’s complement B3 B2 B1 B0
SUB -1
2’s complement B3 B2 B1 B0
The data A3A2 A1A0 will be added to the 2’s complement of B3 B2 B1B0 to produce the SUM (i.e. the
difference between the addend and the augend).
7486 is a quad Ex-OR gate, which can be used as a controlled inverter. 7483 is a TTL circuit with 4-full
adders i.e. it can add a nibble. The carry out pin 14 may be connected to the carry in pin 13 of the next
7483 to add 8-bit numbers.
PROCEDURE:
1) Put IC on the breadboard.
2) Apply 5V supply at pin 5.
3) Apply ground at pin 12.
4) Make connections as shown in the circuit diagram.
5) Keep SUB input LOW for Addition.
6) Keep SUB input HIGH for Subtraction.
7) Observe the different outputs.
OBSERVATION TABLE:
S. No. Carry in Input Input Carry out Output
C0 A4A3A2A1 B4B3B2 B1 C4 S4S3S2S1
1.
2.
3.
4.
5.
CIRCUIT DIAGRAM:
RESULT: The sum and difference of 4 bit numbers is exactly same as calculated theoretically.
PRECAUTIONS: -
1. Connection should be tight.
2. IC’s should be handled carefully
Experiment 4
OBJECT: Breadboard implementation of SR and D- flip flop and verify their characteristic table.
APPARATUS REQUIRED: - IC -7400, IC- 7404, and logic trainer board, connecting wires.
D-FLIP FLOP: -
The storage elements employed in clocked sequential circuits are called flip-flop. A flip-flop is a
binary storage bit of information .A flip-flop maintains a binary state until directed by clock pulse to switch
states. Theory of T flip-flop is presented below.
Flip-Flops
The memory elements in a sequential circuit are called flip-flops. A flip-flop circuit has two outputs, one for
the normal value and one for the complement value of the stored bit. Binary information can enter a flip-
flop in a variety of ways and gives rise to different types of flip-flops.
Introduction - Basic Flip-Flop Circuit
A flip-flop circuit can be constructed from two NAND gates or two NOR gates. These flip-flops
are shown in Figure 2 and Figure 3. Each flip-flop has two outputs, Q and Q', and two inputs, set and reset.
This type of flip-flop is referred to as an SR flip-flop or SR latch. The flip-flop in Figure 2 has two useful
states. When Q=1 and Q'=0, it is in the set state (or 1-state). When Q=0 and Q'=1, it is in the clear state (or
0-state). The outputs Q and Q' are complements of each other and are referred to as the normal and
complement outputs, respectively. The binary state of the flip-flop is taken to be the value of the normal
output.
When a 1 is applied to both the set and reset inputs of the flip-flop in Figure 2, both Q and Q' outputs go
to 0. This condition violates the fact that both outputs are complements of each other. In normal
operation this condition must be avoided by making sure that 1's are not applied to both inputs
simultaneously.
The NAND basic flip-flop circuit in Figure 3(a) operates with inputs normally at 1 unless the state of the
flip-flop has to be changed. A 0 applied momentarily to the set input causes Q to go to 1 and Q' to go to
0, putting the flip-flop in the set state. When both inputs go to 0, both outputs go to 1. This condition
should be avoided in normal operation.
PROCEDURE:
1. Insert ICs according to the circuit diagram on the trainer board.
2. Give +5V supply to the pin 14 and ground to the pin 7 to all ICs.
3. Give inputs S, R and CLK to the respective pins of the ICs and observe the output at output logic.
4. Observe LEDs output.
5. Try with different combination of input S and R.
6. Prepare truth table, observe and verify it.
PRECAUTION:
1. All connection should be tight.
2. After all connection of the circuit, the main supply should be ON.
CIRCUIT DIAGRAM:
Experiment 5
OBJECT: Design of counters.
APPARATUS REQUIRED: -
S. No. Equipment Qty.
1 Module-n-counter trainer 1
2 Connecting Leads 6
THEORY: A counter is one of the most useful and versatile sub systems in a digital system. A counter driven by a
clock can be used to count the number of the clock cycles. Since the clock pulses occur at known intervals, the
counter can be used as an instrument for measuring time and therefore period or frequency. There are basically two
different types of counters: Synchronous and Asynchronous.
Module-N-counter is a one type of counter, in which, instead of counting from the beginning to the ending,
we can restrict the counter to count up to some set value and then to the beginning value. This can be achieved by
feeding the particular output to the reset input through digital gates.
The 74190 and 191 are synchronous, reversible up/down counters. Having all flip-flops clocked
simultaneously, so that the outputs change coincide with each other when so instructed by the steering logic
provides synchronous counting operation. The mode of operation eliminates the output counting spikes normally
associated with asynchronous (ripple clock) counters. The outputs of the four flip-flops are triggered on a low-to-
high level transition of the clock input if the enable (CTEN) is LOW. A high at CTEN inhibits counting the
direction of the count is determined by the level of the down/up (D/U) input. When D/U is LOW, the counter
counts up and when D/U is high, it counts down.
PROCEDURE:
1. Switch ON the experimental kit.
2. Make sure that the counter output is zero and put the U/D switch in ‘U’ position.
3. Connect the pulser output to the clock input of the counter. At the time of connecting pulser, counter
output may change. In that case, switch OFF the trainer and again switch it ON.
4. Now for each pulse, counter output changes from 0000 to 1001.
5. Put the U/D switch in down position and the counter counts in reverse direction.
6. Again put the U/D switch in ‘U’ mode and connect the 3-input NAND gate output to the load input of the
counter.
7. Now depending upon the requirement, particular outputs are connected to the NAND gate inputs.
For example: To construct a module-5counterwhose binary output is 0101, connect second MSB bit and LSB bit
(which are ‘1’ (high outputs) to the NAND gate inputs. Now the counter counts from 0000 to 0100 resulting as a
module-5-counter.
NOTE: In down counting mode, we cannot use this counter as module-N-counter because MSB bit initially
activates.
PRECAUTIONS:
THEORY: The Counter driven by a clock is used to count number of clock pulses occurs at known intervals. A
binary ripple counter can be constructed by use of clocked JK flip-flops. The system clock is square wave, drives flip
flop A, the output of A drives B & the O/P of B drives flip flop C. All the JK I/P is tied to +Vcc. This means that
each flip-flop will change stage (toggle) with negative transition at its clock input.
When the O/P of the clock is used as the clock I/O for the next flip flop, We call the Counter a Ripple counter &
asynchronous counter .The A-flip flop must change state before it can trigger the B flip flop, and the B-flip flop has
to change states before it can trigger the C flip flop. The triggers move through the flip flop like a Ripple in water,
Because of this the over all propagation delay time is the sum of the individual delays.
OBSERVATION:
MR1 MR2 Output
0 0 Count
0 1 Count
1 0 Count
1 1 No Count
C/k D C B A Count
П L L L L 0
П L L L H 1
п L L H L 2
п L L H H 3
п L H L L 4
п L H L H 5
п L H H L 6
п L H H H 7
п H L L L 8
п H L L H 9
п H L H L 10
п H L H H 11
п H H L L 12
п H H L H 13
п H H H L 14
п H H H H 15
PROCEDURE:
PRECAUTIONS: -
1. Connection should be tight.
2. O/P should be finding sequentially.
3. IC’s should be handled carefully.
CIRCUIT DIAGRAM:
EXPERIMENT No - 7
OBJECT: -Breadboard implementation of Shift Register.
APPARATUS USED: -
THEORY: - A register is simply a group of flip-flop that can be used to store a binary no. of a group of Flip- flop
connected to provide either or both of these function is called shift register.
To allow the data in the word to read in to the register serially. The o/p of the flip-flop is connected to the i/p of
the following binary such a configuration called a Shift register.
There are two ways to shift the data into a register (serial and parallel) and similarly two ways to shift the data out of
the register. This leads to construction of four types of registers.
Fig. IC Type 74194 Bidirectional Shift Register with Parallel Load
EXPERIMENT No. - 8
EXPERIMENT: Implementation of arithmetic algorithms.
APPARATUS REQUIRED:
S.No. Equipment Qty.
1 General purpose digital trainer 1
2 IC-74181 1
THEORY: - Arithmetic logic unit is a multipurpose device capable of providing several different arithmetic and
logic operations. The specific operation to be performed is selected by the user by placing a specific binary code on
the mode select i/p. ALU s are available in large scale integrated circuit packages.
Functional block diag. For 74181 ALU is shown in fig. It is a 4-bit ALU, which provides 16 arithmetic plus 16 logic
operations. The unit accepts two 4-bit words (A3 A2 A1 A0 and B3 B2 B1 B0) and a carry i/p Cn as i/p’s.
The operation to be performed on these i/p are determined by logic levels on i/ps
PROCEDURE:
OBSERVATION TABLE:
PRECAUTIONS: -
1. Connection should be tight.
2. O/P should be finding sequentially.
3. IC’s should be handled carefully.
2.Truth Table (SISO)
Input Output
tn tn+8
Ds1 Ds2 Q7
L L L
L H L
H L L
H H H
3.Truth Table (SIPO)
Shift right H L H L X X L q0 q1 q2
H L H H X X H q0 q1 q2
Parallel load H H H X X Pn P0 P1 P2 P3
RESULT:- All Shift Register Verify With the given truth table.
PRECAUTIONS: -
1. Connection should be tight.
2. O/P should be finding sequentially.
3. IC’s should be handled carefully.
EXPERIMENT No.-9
EXPERIMENT: Breadboard implementation of seven-segment display.
APPARATUS REQUIRED:
S.No. Equipment Qty.
1 General purpose digital trainer 1
2 LEDs 1
THEORY: A BCD to seven-segment decoder is a combinational circuit that accepts a decimal digit in BCD and
generates the appropriate outputs for selection of segments in display indicator used for displaying the decimal
digits. The seven outputs of decoder (a, b, c, d, e, f, g) selects the corresponding segments in the display as shown in
the fig.1.the numeric designation chosen to represent the decimal digits
a
f b
g
e c
d
fig.1
PROCEDURE:
1. Put IC on the breadboard.
2. Make connections as shown in the circuit diagram.
3. Observe the different outputs.
OBSERVATION TABLE: