CO_Lab_Manual final 2023-24
CO_Lab_Manual final 2023-24
CO_Lab_Manual final 2023-24
Roll. No.:
Group/Branch:
Table of Contents
1. Vision and Mission of the Institute
2. Programme Educational Objectives (PEOs)
3. Programme Outcomes (POs)
4. Programme Specific Outcomes (PSOs)
5. University Syllabus
6. Course Outcomes (COs)
7. CO- PO and CO-PSO mapping
8. Course Overview
9. List of Experiments
10. DOs and DON’Ts
11. General Safety Precautions
12. Guidelines for students for report preparation
13. Lab assessment criteria
14. Details of Conducted Experiments
15. Lab Experiments
University Syllabus
1. Implementing HALF ADDER, FULL ADDER using basic logic gates
2. Implementing Binary -to -Gray, Gray -to -Binary code conversions.
3. Implementing 3-8 line DECODER.
4. Implementing 4x1 and 8x1 MULTIPLEXERS.
5. Verify the excitation tables of various FLIP-FLOPS.
6. Design of an 8-bit Input/ Output system with four 8-bit Internal Registers.
7. Design of an 8-bit ARITHMETIC LOGIC UNIT.
8. Design the data path of a computer from its register transfer language description.
9. Design the control unit of a computer using either hardwiring or microprogramming based
on its register transfer language description.
10. Implement a simple instruction set computer with a control unit and a data path.
CO-PO Mapping:
PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
C.1 3 3 2 2 2 2
C.2 3 3 2 2 2 2
C.3 3 3 2 2 2 2
C.4 2 3 2 2 2
CO-PSO Mapping
Course Overview
During the first set of Experiments, students become familiar with basic digital hardware by
constructing simple combinational circuits, and learning troubleshooting skills. During the
second set of Experiments, students become familiar with arithmetic logic unit and control unit.
Finally, students apply their knowledge to the design a simple instruction set computer.
Because students are constructing complete computer organization projects, the computer
organization lab typically requires more effort than traditional laboratory courses.
2.
Implementing Binary -to -Gray, Gray -to -Binary code conversions. C.1
3.
Implementing 3-8 line DECODER. C.1
4.
Implementing 4x1 and 8x1 MULTIPLEXERS. C.1
6. Design of an 8-bit Input/ Output system with four 8-bit Internal Registers.
C.2
Design the data path of a computer from its register transfer language
8.
description. C.4
Implement a simple instruction set computer with a control unit and a data
10.
path. C.4
DON’Ts
1. Do not share your username and password.
2. Do not remove or disconnect cables or hardware parts.
3. Do not personalize the computer setting.
4. Do not run programs that continue to execute after you log off.
5. Do not download or install any programs, games or music on computer in Lab.
6. Personal Internet use chat room for Instant Messaging (IM) and Sites Strictly
Prohibited.
7. No Internet gaming activities allowed.
8. Tea, Coffee, Water & Eatables are not allowed in the Computer Lab.
1. To break the victim with live electric source .Use an insulator such as fire wood or
plastic to break the contact. Do not touch the victim with bare hands to avoid the risk
of electrifying yourself.
2. Unplug the risk of faulty equipment. If main circuit breaker is accessible, turn the
circuit off.
3. If the victim is unconscious, start resuscitation immediately, use your hands to press the
chest in and out to continue breathing function. Use mouth-to-mouth resuscitation if
necessary.
4. Immediately call medical emergency and security. Remember! Time is critical; be best.
1) All files must contain a title page followed by an index page. The files will not be signed by
the faculty without an entry in the index page.
2) Student’s Name, Roll number and date of conduction of experiment must be written on all
pages.
Note:
1. Students must bring their lab record along with them whenever they come for the lab.
clearly
explained
LAB EXPERIMENTS
LAB EXPERIMENT 1
BRIEF DESCRIPTION:
To design and implement half adder using logic gates
HALF ADDER
OUTPUTS
INPUT A INPUT B
S C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
FULL ADDER
PRE-EXPERIMENT QUESTIONS:-
PROCEDURE:-
POST-EXPERIMENT QUESTIONS:-
LAB EXPERIMENT 2
SL.
Equipments Specification Quantity
No.
1 Digital IC Trainer kit - 1
2 Digital Multimeter 1
SL.
Components Specification Quantity
No.
7400, 7402,
7404,
1 each
1 Digital ICs 7408, 7432,
7486.
- 6
2 Patch cords
BRIEF DESCRIPTION:
Pin diagram of Binary to gray code converter using 7486 IC (ex-or Gate)
INPUTS OUTPUTS
A B C D G4 G3 G2 G1
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
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
Truth Table
Pin diagram of Gray to Binary code converter using 7486 Ic(Exor Gate)
INPUTS OUTPUTS
A B C D B3 B2 B1 B0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 1 0 0 1 0
0 0 1 0 0 0 1 1
0 1 1 0 0 1 0 0
0 1 1 1 0 1 0 1
0 1 0 1 0 1 1 0
0 1 0 0 0 1 1 1
1 1 0 0 1 0 0 0
1 1 0 1 1 0 0 1
1 1 1 1 1 0 1 0
1 1 1 0 1 0 1 1
1 0 1 0 1 1 0 0
1 0 1 1 1 1 0 1
1 0 0 1 1 1 1 0
1 0 0 0 1 1 1 1
TRUTH TABLE
PRE-EXPERIMENT QUESTIONS:-
PROCEDURE:-
POST-EXPERIMENT QUESTIONS:-
LAB EXPERIMENT 3
BRIEF DESCRIPTION:
a) 2 to 4Decoder using logic gates:
PRE-EXPERIMENT QUESTIONS:
1. Difference between Encoder and Decoder.
2. Explain the need of multiplexer.
PROCEDURE:
Collect the components necessary to accomplish this experiment.
Plug the IC chip into the breadboard.
Connect the supply voltage and ground lines to the chips. PIN7 = Ground
and PIN14 = +5V.
Make connections as shown in the respective circuit diagram.
Connect the inputs of the gate to the input switches of the LED.
Connect the output of the gate to the output LEDs.
Once all connections have been done, turn on the power switch of the breadboard
Operate the switches and fill in the truth table ( Write "1" if LED is ON and "0" if L1
is OFF Apply the various combination of inputs according to the truth tab alend
observe the condition of Output LEDs.
LAB EXPERIMENT 4
BRIEF DESCRIPTION:
a) 4 to 1 MULTIPLEXERS:
Addressing Input
b a Selected
0 0 A
0 1 B
1 0 C
1 1 D
d) 8x1 Multiplexer
0 0 0 0 × × × × × × × 0 × 0
0 0 0 1 × × × × × × × 1 × 1
0 0 1 × 0 × × × × × × 0 × 0
0 0 1 × 1 × × × × × × 1 × 1
0 1 0 × × 0 × × × × × 0 × 0
0 1 0 × × 1 × × × × × 1 × 1
0 1 1 × × × 0 × × × × 0 × 0
0 1 1 × × × 1 × × × × 1 × 1
1 0 0 × × × 0 × × × × 0 0
1 0 0 × × × × 1 × × × × 1 1
1 0 1 × × × × × 0 × × × 0 0
1 0 1 × × × × × 1 × × × 1 1
1 1 0 × × × × × × 0 × × 0 0
1 1 0 × × × × × × 1 × × 1 1
1 1 1 × × × × × × × 0 × 0 0
1 1 1 × × × × × × × 1 × 1 1
PROCEDURE:-
Collect the components necessary to accomplish this experiment.
Plug the IC chip into the breadboard.
Connect the supply voltage and ground lines to the chips. PIN7 = Ground
and PIN14 = +5V.
Make connections as shown in the respective circuit diagram.
Connect the inputs of the gate to the input switches of the LED.
Connect the output of the gate to the output LEDs.
Once all connections have been done, turn on the power switch of the breadboard
Operate the switches and fill in the truth table ( Write "1" if LED is ON and "0" if L1
is OFF Apply the various combination of inputs according to the truth table and
observe the condition of Output LEDs.
LAB EXPERIMENT 5
BRIEF DESCRIPTION:
Flip flops are the basic building blocks in any memory systems since its output will
remain in its state until it is forced to change it by some means.
S R FLIP FLOP:
S and R stands for set and reset. There are four input combination possible at the inputs.
But = =1 is forbidden since the output will be indeterminate.
J K FLIP FLOP
The indeterminate output state of SR FF when S=R=1 is avoided by converting it to a JK FF.
When flip flop is switched on its output state is uncertain. When an initial state is to be
assigned two separate inputs called preset and clear are used. They are active low inputs
D Flip flop
It has only one input called as D input or Data input. The input data is transferred to the
output after a clock is applied. D FF can be derived from JK FF by using J input as D input
and J is inverted and fed to K input.
T Flip Flop
T stands for Toggle. The output toggles when a clock pulse is applied. T FF can be derived
from JK FF by shorting J and K input.
PRE-EXPERIMENT QUESTIONS:-
PROCEDURE:-
Test all components and IC packages using digital IC tester and multimeter
Set up FF using Gates and verify their truth tables
Verify the Truth tables of 7473, 7474, and 7476 ICs
POST-EXPERIMENT QUESTIONS:-
LAB EXPERIMENT6
BRIEF DESCRIPTION:
A register is capable of shifting its binary information in one or both directions is known
as shift register. The logical configuration of shift register consist of a D-Flip flop
cascaded with output of one flip flop connected to input of next flip flop. All flip flops
receive common clock pulses which causes the shift in the output of the flip flop. The
simplest possible shift register is one that uses only flip flop. The output of a given flip
flop is connected to the input of next flip flop of the register. Each clock pulse shifts the
content of register one bit position to right.
PIN DIAGRAM
TRUTH TABLE
OUTPUT
CLK DATA QA QB QC Q
D
1 1 1 0 0 0
2 0 0 1 0 0
3 0 0 0 1 1
4 1 1 0 0 1
LOGIC DIAGRAM TRUTH TABLE
PRE-EXPERIMENT QUESTIONS:-
1. State the features of IC 7495.
2. State the features of IC 74195.
PROCEDURE:-
Connections are given as per circuit diagram.
Logical inputs are given as per circuit diagram.
Observe the output and verify the truth table.
POST-EXPERIMENT QUESTIONS:-
LAB EXPERIMENT: 7
BRIEF DESCRIPTION:
ALU stands for the arithmetic and logical unit and is one of the important unit in almost all
the calculating machine these days be it with the hand-held mobile, or computers. All the
computational work in the system are carried out by this unit. The typical ALU sizes are :
4-bit ALU : ALU that processes two 4-bit numbers.
8-bit ALU: ALU that processes two 8-bit numbers.
Still in the latest systems ALU sizes are 16, 32, 64-bit etc.Figure-1 shows the block diagram
of a typical ALU.
In figure-1, the 1x2 selector on the left is as a mode selector to select one of the two units i.e.
either the arithmetic unit or the logical unit. The function select lines are then used to select
one of the many functions of arithmetic or the logical type.
MSI package for ALU:- IC 74181 a 4-bit Arithmetic and logical unit:
PRE-EXPEIMENT QUESTIONS:-
1. What is Digitizing?
PROCEDURE:-
Keep the datasheet of IC 74181 ready.
Insert the IC on the Breadboard.
Make connections as shown in figure.
Verify the connections
POST-EXPEIMENT QUESTIONS:-
1. Which Boolean operator combines search terms so that each search result contains all
term ?
LAB EXPERIMENT 8
OBJECTIVE: Design a data path of a computer from its register transfer language
description.
BRIEF DESCRIPTION:
The symbolic notation used to describe the micro-operation transfers among registers is called
Register Transfer Language. The term “register transfer” implies the availability of hardware
logic circuits that can perform a stated micro-operation and transfer the result of the operation
to the same or another register.
A statement that specifies a register transfer implies that circuits are available from the outputs
of the source register to the inputs of the destination register and that the destination register
has a parallel load capacity. If the transfer is to occur under a predetermined condition i.e.
If(P=1) then R2←R1
Where P is the control signal generated in the control section. A Control Function is a Boolean
variable that is equal to 0 or 1
P: R2←R1
P
Control Unit R2
clock
load n=no of bits of the register
R1
BLOCK DIAGRAM
PRE-EXPERIMENT QUESTIONS:-
PROCEDURE:-
In the next clock pulse the value gets transferred to register R2 if its Enable input is high, i.e.
its control function x.(y+z) =1
POST-EXPERIMENT QUESTIONS: -
1. How a data path is designed?
2. Design a data path for R3 R2 + R1
LAB EXPERIMENT 9
OBJECTIVE: Design a data path of a computer from its register transfer language description.
EQUIPMENTS&COMPONENTS REQUIRED:
Registers
AND Gates
OR Gate
Connecting Wires
BREIF DESCRIPTION:
The symbolic notation used to describe the micro-operation transfers among registers is
called Register Transfer Language.
The term “register transfer” implies the availability of hardware logic circuits that can perform
a stated micro-operation and transfer the result of the operation to the same or another register.
A statement that specifies a register transfer implies that circuits are available from the outputs
of the source register to the inputs of the destination register and that the destination register
has a parallel load capacity.
If the transfer is to occur under a predetermined condition i.e
If(P=1) then R2←R1
Where P is the control signal generated in the control section. A Control Function is a Boolean
variable that is equal to 0 or 1
P: R2←R1
P
Control Unit R2
clock
load
n=no of bits of the register
R1
BLOCKDIAGRAM
PRE-EXPERIMENT QUESTIONS:-
1. What is RTL?
2. What is the minimum no. of registers needed in the instruction set architecture of the
processor to compile a code with 3 operands?
PROCEDURE:-
Data bits Ready to be transfered
In the next clock pulse the value gets transferred to register R2 if its Enable input is high, i.e
its control function x.(y+z) =1
POST-EXPERIMENT QUESTION:-
LAB EXPERIMENT 10
OBJECTIVE:Design the control unit of a computer using hardwired based on its register
transfer language description.
PRE-EXPERIMENT QUESTION:-
PROCEDURE:-
The CPU has an 8-bit data bus and an 8-bit address bus, so it can only support 256 bytes of
memory to hold both instructions and data.
Internally, there are four 8-bit registers, R0 to R3, plus an Instruction Register, the
Program Counter, and an 8-bit register which holds immediate values.
The ALU is the same one that we designed last week. It performs the four operations
AND, OR, ADD and SUB on two 8-bit values, and supports signed ADDs and SUBs.
The CPU is a load/store architecture: data has to be brought into registers for
manipulation, as the ALU only reads from and writes back to the registers.
The ALU operations have two operands: one register is a source register, and the
second register is both source and destination register, i.e. destination register =
destination register OP source register.
All the jump operations perform absolute jumps; there are no PC-relative branches.
There are conditional jumps based on the zeroness or negativity of the destination
register, as well as a "jump always" instruction.
The following diagram shows the datapaths in the CPU:
The dbus and sbus labels indicate the lines coming out from the register file which
hold the value of the destination and source registers.
Note the data loop involving the registers and the ALU, whose output can only go
back into a register.
The dataout bus is only connected to the dbus line, so the only value which can be
written to memory is the destination register.
Also note that there are only 3 multiplexors:
o the address bus multiplexor can get a memory address from the PC, the
immediate register (for direct addressing), or from the source or destination
registers (for register indirect addressing).
o the PC multiplexor either lets the PC increment, or jump to the value in the
immediate register.
o the multiplexor in front of the registers determines where a register write
comes from: the ALU, the immediate register, another register or the data bus.
As we have decided the hardware to be used in our design now we have to decide the
instruction set for our computer.
Instruction Set
Half of the instructions in the instruction set fit into one byte:
op1 op2 Rd Rs
2 2 2 2
Note the regularity of the ALU operations and the jump operations: we can feed
the op2 bits directly into the ALU, and use op2 to control the branch decision.
The rest of the instruction set is less regular, which will require special decoding for
certain of the 16 instructions.
Instruction Phases
The CPU internally has three phases for the execution of each instruction.
On phase 0, the instruction is fetched from memory and stored in the Instruction
Register.
On phase 1, if the fetched instruction is a two-byte instruction, the second byte is
fetched from memory and stored in the Immediate Register. For one-byte instructions,
nothing occurs in phase 1.
On phase 2, everything else is done as required, which can include:
o an ALU operation, reading from two registers.
o a jump decision which updates the PC.
o a register write.
o a read from a memory location.
o a write to a memory location.
After phase 2, the CPU starts the next instruction in phase 0.
Below is the main CPU diagram again, this time with the control lines shown.
The values for all of these control lines are generated by the Decode Logic, which
gets as input the value from the Instruction Register, and the zero & negative lines of
the destination register.
Phase Zero
On phase zero, the PC's value has to be placed on the address bus, so the addrsel line
must be 0. The irload line needs to be 1 so that the IR is loaded from the datain bus.
Finally, the PC must be incremented in case we need to fetch an immediate value in
phase 1.
All of this can be done using multiplexors which output different values depending on
the current phase. Here is the control logic for the irload line.
We only need to load the IR on phase 0, so we can wire true to the 0 input of
the irload multiplexor, and false to the other inputs. Note: input 11 (i.e. decimal 3) to
the multiplexor is never used, as we never get to phase 3, but Logisim wants all
multiplexor inputs to be valid.
Another way to look at each phase is the value which needs to be set for each control
line, for each instruction.
For phase zero, these control line values can be set for all instructions:
op op instru pcse pcloa Irloa imloa R dwrit jumps addrs regs dre sre aluo
1 2 ct l d d d w e el el el g g p
xx xx all 1 1 1 0 0 0 0 0 x x x x
'x' stands for any value, i.e. accept any opcode value, output any control line value.
Phase One
On phase 1, we need to load the Immediate Register with a value from memory if
the irbit7 from the IR is true. The PC's value has to be placed on the address bus, so
the addrsel line must be 0. The imload line needs to be 1 so that the Immediate
Register is loaded from the datain bus. Finally, the PC must be incremented so that
we are ready to fetch the next instruction on the next phase 0.
The imload logic is shown above. It is very similar to the irload logic, but this time an
enable value is output only on phase 1, and only if the irbit7 is set.
Some of the pcload logic is shown above. The PC is always incremented at phase 0. It
is incremented at phase 1 if irbit7 is set, i.e. a two-byte instruction. Finally, the PC
can be loaded with an immediate value in phase 2 if we are performing a jump
instruction and the jump test is true. We will come back to the jump logic later.
We can tabulate the values of the control lines for phase 1. This time, what is output
depends on the top bit of the op1 value:
op op instru pcse pcloa Irloa imloa R dwrit jumps addrs regs dre sre aluo
1 2 ct l d d d w e el el el g g p
0x xx all x 0 0 0 0 0 0 0 x x x x
1x xx all 1 1 0 1 0 0 0 0 x x x x
Phase Two
Here, the values of the control lines depend heavily on what specific instruction we
are performing. Here's the table of control line outputs depending on the instruction:
op1 op2 instruct pcsel pcload irload imload rw dwrite addrsel regsel dreg sreg aluop
00 01 OR Rd, Rs x 0 0 0 0 1 x 3 Rd Rs op2
01 00 LW Rd, (Rs) x 0 0 0 0 1 2 2 Rd Rs x
01 01 SW Rd, (Rs) x 0 0 0 1 0 3 x Rd Rs x
01 10 MOV Rd, Rs x 0 0 0 0 1 x 1 Rd Rs x
01 11 NOP x 0 0 0 0 0 x x x x x
11 00 LW Rd, immed x 0 0 0 0 1 1 2 Rd x x
11 01 SW Rd, immed x 0 0 0 1 0 1 x Rd x x
11 10 LI Rd, immed x 0 0 0 0 1 x 0 Rd x x
11 11 JMP immed 0 1 0 0 0 0 x x x x x
To make the control line logic as simple as possible, a CPU designer is always
striving for regularity. However, this is often in conflict with the desired CPU
functionality.
From the table above, the ALU instructions (op1=00) and the jump instructions
(op1=10) are nice and regular. All the op1=1x instructions use the Immediate
Register, while the op1=0x instructions don't.
We can always tie dregsel to Rd from the instruction, and the same goes
for sregsel = Rs and aluop = op2. And irload and imload are always 0 for phase 2.
With the remaining control lines, the regularities cease.
POST-EXPERIMENT QUESTION:-
1. Which DMA transfer mode and interrupt handling mechanism will enable the
highest I/O bandwidth.