COA Lab Manual
COA Lab Manual
B.E. Semester 4
of this Institute (GTU Code: 013 ) has satisfactorily completed the Practical
work for the subject Computer Organization & Architecture (3140707) for
Place: _________________
Date: __________________
By using this lab manual students can go through the relevant theory and procedure in advance
before the actual performance which creates an interest and students can have basic idea prior to
performance. This in turn enhances pre-determined outcomes amongst students. Each experiment
in this manual begins with competency, industry relevant skills, course outcomes as well as
practical outcomes (objectives). The students will also achieve safety and necessary precautions to
be taken while performing practical.
This manual also provides guidelines to faculty members to facilitate student centric lab activities
through each experiment by arranging and managing necessary resources in order that the students
follow the procedures with required safety and necessary precautions to achieve the outcomes. It
also gives an idea that how students will be assessed by providing rubrics.
Computer Architecture is concerned with the way hardware components are connected together to
form a computer system. It acts as the interface between hardware and software. Computer
Architecture helps us to understand the functionalities of a system. A programmer can view
architecture in terms of instructions, addressing modes and registers. While designing a computer
system architecture is considered first. Computer Architecture deals with high-level design issues.
Architecture involves Logic (Instruction sets, Addressing modes, Data types, Cache optimization).
Utmost care has been taken while preparing this lab manual however always there is chances of
improvement. Therefore, we welcome constructive suggestions for improvement and removal of
errors if any.
DTE’s Vision
To provide globally competitive technical education.
Remove geographical imbalances and inconsistencies.
Develop student friendly resources with a special focus on girls’ education and support to
weaker sections.
Develop programs relevant to industry and create a vibrant pool of technical professionals.
Institute’s Vision
To be a premier engineering institution, imparting quality education for innovative
solutions relevant to society and environment.
Institute’s Mission
To develop human potential to its fullest extent so that intellectual and innovative engineers
can emerge in a wide range of professions.
To advance knowledge and educate students in engineering and other areas of scholarship
that will best serve the nation and the world in future.
To produce quality engineers, entrepreneurs and leaders to meet the present and future
needs of society as well as environment.
Department’s Vision
To achieve excellence for providing value based education in Computer Engineering
through innovation, team work and ethical practices.
Department’s Mission
To produce computer science and engineering graduates according to the needs of industry,
government, society and scientific community.
To develop partnership with industries, government agencies and R and D Organizations.
To motivate students/graduates to be entrepreneurs.
To motivate students to participate in reputed conferences, workshops, symposiums,
seminars and related technical activities.
Sr. CO CO CO CO CO
Objective(s) of Experiment
No. 1 2 3 4 5
Study the basic structure and functional units of digital
1. √
computer.
2. Write the working of 8085 simulator GNUsim8085. √ √
3. Study basic architecture of 8085 along with small introduction. √ √
Write following 8085 assembly language programs.
a. To add two 8-bit numbers and store result in memory
location.
b. To add five 8-bit numbers and store sum and carry in
memory location.
c. Perform addition of two 8-bit numbers and store result after
4.
using DAA instruction.
√
d. Perform 16-bit subtraction.
e. Perform multiplication of two 8-bit numbers using loop.
f. Find minimum and maximum from five 8-bit numbers
stored in memory location.
g. To count the no. of 1’s in given 8-bit value.
Write following 8085 assembly language programs.
a. To add two arrays of five 8-bit values and store result in
third array.
b. To store sum of unpacked BCD numbers from packed BCD
numbers.
5. √
c. To store an ASCII value of each Hex digits.
d. To set an MSB of an 8-bit values if it has even no. of 1’s.
e. To reverse an array of ten 8-bit values using subroutine.
f. Find factorial of given 8-bit value.
g. To perform division of 16-bit number by 8-bit number.
6. Design ALU using Logisim. √
7. Implement Booth’s multiplication algorithm. √
Study interconnection structures of components of
8. √ √ √
multiprocessor system.
1. The student will demonstrate an understanding of the history, key terminology, and current
industry trends in computer architecture.
2. The student will demonstrate an understanding of how data is represented within a computer
system.
3. The student will demonstrate an understanding of the processor (CPU) subsystem.
4. The student will demonstrate an understanding of the memory subsystem and hierarchy.
5. The student will demonstrate an understanding of the various types of storage and the
Input/output (I/O) subsystem.
6. The student will demonstrate an understanding of the issues associated with multiprocessors
and benchmarking.
Index
(Progressive Assessment Sheet)
Experiment No: 1
Date: _________________
Study the basic structure and functional units of digital computer.
Competency and Practical Skills: Not required
Objectives:
Explanation:
There are a few basic components that aid the working-cycle of a computer i.e. the Input-
Process-Output Cycle and these are called as the functional components of a computer. It needs
certain input, processes that input and produces the desired output. The input unit takes the input,
the central processing unit does the processing of data and the output unit produces the output. The
memory unit holds the data and instructions during the processing.
Digital Computer: A digital computer can be defined as a programmable machine which reads the
binary data passed as instructions, processes this binary data, and displays a calculated digital
output. Therefore, digital computers are those that work on the digital data.
Input Unit:
The input unit consists of input devices that are attached to the computer. These
devices take input and convert it into binary language that the computer understands. Some
of the common input devices are keyboard, mouse, joystick, scanner etc.
Central Processing Unit (CPU):
Once the information is entered into the computer by the input device, the processor
processes it. The CPU is called the brain of the computer because it is the control center of
the computer. It first fetches instructions from memory and then interprets them so as to know
what is to be done. If required, data is fetched from memory or input device. Thereafter CPU
executes or performs the required computation and then either stores the output or displays
on the output device. The CPU has three main components which are responsible for different
functions – Arithmetic Logic Unit (ALU), Control Unit (CU) and Memory registers
The ALU, as its name suggests performs mathematical calculations and takes logical
decisions. Arithmetic calculations include addition, subtraction, multiplication and division.
Logical decisions involve comparison of two data items to see which one is larger or smaller
or equal.
Control Unit:
The Control unit coordinates and controls the data flow in and out of CPU and also
controls all the operations of ALU, memory registers and also input/output units. It is also
responsible for carrying out all the instructions stored in the program. It decodes the fetched
instruction, interprets it and sends control signals to input/output devices until the required
operation is done properly by ALU and memory.
Memory Registers:
A register is a temporary unit of memory in the CPU. These are used to store the data
which is directly used by the processor. Registers can be of different sizes(16 bit, 32 bit, 64
bit and so on) and each register inside the CPU has a specific function like storing data, storing
an instruction, storing address of a location in memory etc. The user registers can be used by
an assembly language programmer for storing operands, intermediate results etc.
Accumulator (ACC) is the main register in the ALU and contains one of the operands of an
operation to be performed in the ALU.
Memory:
Memory attached to the CPU is used for storage of data and instructions and is called
internal memory. The internal memory is divided into many storage locations, each of which
can store data or instructions. Each memory location is of the same size and has an address.
With the help of the address, the computer can read any memory location easily without
having to search the entire memory. When a program is executed, its data is copied to the
internal memory and is stored in the memory till the end of the execution. The internal
memory is also called the Primary memory or Main memory. This memory is also called as
RAM, i.e. Random Access Memory. The time of access of data is independent of its location
in memory; therefore this memory is also called Random Access memory (RAM).
Output Unit:
The output unit consists of output devices that are attached with the computer. It
converts the binary data coming from CPU to human understandable form. The common
output devices are monitor, printer, plotter etc.
A computer consists of input unit that takes input, a CPU that processes the input and an
output unit that produces output. All these devices communicate with each other through a common
bus. A bus is a transmission path, made of a set of conducting wires over which data or information
in the form of electric signals is passed from one component to another in a computer. The bus can
be of three types – Address bus, Data bus and Control Bus.
The address bus carries the address location of the data or instruction. The data bus carries data
from one component to another and the control bus carries the control signals. The system bus is
the common communication path that carries signals to/from CPU, main memory and input/output
devices. The input/output devices communicate with the system bus through the controller circuit
which helps in managing various input/output devices attached to the computer.
Conclusion:
Quiz:
Suggested Reference:
Good Average Good Average Good Satisfactory Good Satisfactory Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 2
Date: _________________
Write the working of 8085 Simulator GNUsim8085.
Objectives:
Explanation:
8085 simulator is software on which instructions are executed by writing the programs in assembly
language.
GNUSim8085 is an 8085 microprocessor simulator with following features.
Labels:-
When given to any particular instruction/data in a program, takes the address of that instruction or
data as its value. But it has different meaning when given to EQU directive. Then it takes the
operand of EQU as its value. Labels must always be placed in the first column and must be followed
by an instruction (no empty line). Labels must be followed by a : (colon), to differentiate it from
other tokens.
Operations:-
As mentioned above the operations can be specified in two ways that are mnemonics and pseudo
operation.
Pseudo operations can be defined by using following directives:-
There are only 3 directives currently available in our assembly language.
1. DB - define byte ( 8 bits )
2. DS - define size (no. of bytes)
3. EQU - like minimalistic #define in C
DB is used to define space for an array of values specified by comma separated list. And the label
(if given to the beginning of DB) is assigned the address of the first data item.
DS is used to define the specified number of bytes to be assigned and initialize them to zero. To
access each byte you can use the + or -operator along with label.
EQU behaves similar to #define in C. But it is simple. It can be used to give names only to numeric
constants. Nesting of EQU is not allowed. You can use EQU only in operands for pseudo ops and
mnemonics.
Operands:-
Operands are specified according to the user. The register set specified in the architecture of 8085
(A, B, C, D, E, H and L) are used to access and store data. These registers are specified as operand.
In case of accessing data or storing data in the memory ‘m’ is specified as an operand and the
address of this memory location is taken from the HL pair (data in HL pair).
Picture 2
Step 2: Start writing the code after start: nop in load me at 10 that is at load me at 11.
Picture 3
Step 3: Click on reset and reset all the registers by clicking on reset all.
Picture 4
Step 4: click on the highlighted button to execute the code
Picture 5
Step 5: after you execute the code mention the name your program by writing the name in the name
section as mentioned in the screen shot in picture 5 and the drive where you want to save it. After
that click on save.
Picture 6
Step 6: after this you will see the result of the instructions in the respective registers as seen in the
above picture 6.
Conclusion:
Quiz:
2) How we can set the value at memory location and I/O port?
3) List any five instruction of 8085microprocessor.
Suggested Reference:
Good Average Good Average Good Satisfactory Good Satisfactory Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 3
Date: _________________
Study basic architecture of 8085 along with small introduction.
Objectives:
Explanation:
The architecture of the 8085 microprocessor consists of several key components, including the
accumulator, registers, program counter, stack pointer, instruction register, flags register, data bus,
address bus, and control bus.
Accumulator:
Accumulator is used to perform I/O, arithmetic, and logical operations. It is connected to ALU and
the internal data bus. The accumulator is the heart of the microprocessor because for all arithmetic
operations Accumulator’s 8-bit pin will always there connected with ALU and in most-off times
all the operations carried by different instructions will be stored in the accumulator after operation
performance.
Program Counter:
Program Counter holds the address value of the memory to the next instruction that is to be
executed. It is a 16-bit register.
Stack Pointer:
It works like a stack. In stack, the content of the register is stored that is later used in the program.
It is a 16-bit special register. The stack pointer is part of memory but it is part of Stack operations,
unlike random memory access. Stack pointer works in a continuous and contiguous part of the
memory. Whereas Program Counter (PC) works in random memory locations. This pointer is very
useful in stack-related operations like PUSH, POP, and nested CALL requests initiated by
Microprocessor. It reserves the address of the most recent stack entry.
Temporary Register:
It is an 8-bit register that holds data values during arithmetic and logical operations.
The address bus is a 16-bit bus that is used to address memory and other devices. The address bus
is used to select the memory location or device that the microprocessor wants to access.
The control bus is a set of signals that controls the operations of the microprocessor, including the
read and write operations. The control bus includes signals such as the read signal, write signal,
interrupt signal, and reset signal. The read signal is used to read data from memory or other devices,
the write signal is used to write data to memory or other devices, the interrupt signal is used to
signal the microprocessor that an interrupt has occurred, and the reset signal is used to reset the
microprocessor to its initial state.
Conclusion:
Quiz:
3) What are the data bus, address bus and control bus?
Suggested Reference:
Good Average Good Average Good Satisfactory Good Satisfactory Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 4
Date: _________________
Write following 8085 assembly language programs with output.
Objectives:
Explanation:
LDA 2050H ; Read 8-bit value from memory location 2050H in A register
MOV B, A ; Copy value of A register in B
LDA 2051H ; Read 8-bit value from memory location 2051H in A register
ADD B ; Add register B contents to A and store the sum in A register
STA 2052H ; Store the sum from A register on memory location 2052H
HLT ; Stop the execution
LXI H, 2050H ; Load 16-Bit address in HL register pair (location of first value)
MOV A, M ; Copy value from location stored in HL register pair to A
INX H ; Increment address in HL register pair (location of second value)
ADD M ; Add second value from M to A and store the sum in A register
INX H ; Increment address in HL register pair (location of result to be stored)
MOV M, A ; Store the value from A register to M (location point by HL register pair)
HLT ; Stop the execution
Output:
b. To add five 8-bit numbers and store sum and carry in memory location.
JMP START ; Jump on start label
DATA: DB 01H, 05H, 08H, 99H, ; Five 8-bit values stored named as DATA
12H
COUNT: DB 05H ; Count value is stored in COUNT
SUM: DB 00H ; Initial value of SUM is 00H
CARRY: DB 00H ; Initial value of CARRY is 00H
START: LDA COUNT ; Load COUNT value in A register
MOV C, A ; Copy COUNT value in C register from A
MVI A, 00H ; Clear value of A register (to store sum)
MVI B, 00H ; Clear value of B register (to store carry)
LXI H, DATA ; Load 16-Bit address of DATA in HL register pair
LOOP: ADD M ; Add first value to A register
JNC NEXT ;Check if Carry flag is not set, take jump on label
NEXT
INR B ; if Carry flag is set increment B register value
NEXT: INX H ;Increment address in HL register pair (for other
values)
DCR C ; Decrement C register value (to decrement count
value)
JNZ LOOP ; if Zero flag is not set, take jump on label LOOP
STA SUM ; Store sum from A register in SUM
MOV A, B ; Copy B register value to A (to store carry in CARRY)
; Store carry from A register to CARRY
STA CARRY ; Stop the execution
HLT
Output:
c. Perform addition of two 8-bit numbers and store result after using DAA instruction.
MVI A, 05H ; Store 8-bit value in A register
MVI B, 07H ; Store 8-bit value in B register
ADD B ; Add value of B register to A, sum is in A register ( 05H + 07H = 0CH )
DAA ; Decimal Adjust Accumulator (convert value higher than 09 to BCD)
STA 2050H ; Store the result on the location 2050H
HLT ; Stop the execution
Output:
Conclusion:
Quiz:
Suggested Reference:
Good Average Good Average Good Satisfactory Good Satisfactory Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 5
Date: _________________
Write following 8085 assembly language programs with output.
a. To add two arrays of five 8-bit values and store result in third array.
b. To store sum of unpacked BCD numbers from packed BCD numbers.
c. To store an ASCII value of each Hex digits.
d. To set an MSB of an 8-bit values if it has even no. of 1’s.
e. To reverse an array of ten 8-bit values using subroutine.
f. Find factorial of given 8-bit value.
g. To perform division of 16-bit number by 8-bit number.
Objectives:
Explanation:
a. To add two arrays of five 8-bit values and store result in third array.
JMP START ; Jump on start
DATA1: DB 01, 02, 03, 04, 05 ; First Array
DATA2: DB 06, 07, 08, 09, 10 ; Second Array
SUM: DS 5 ; Third array to store sum
COUNT: DB 05 ; Counter value
START: LXI B, DATA1 ; Load address of DATA1 in BC reg. pair
LXI H, DATA2 ; Load address of DATA2 in HL reg. pair
LXI D, SUM ; Load address of SUM in DE reg. pair
LOOP: LDAX B ; Start of LOOP; Read values from DATA1
ADD M ; Add values from DATA2
STAX D ; Store sum in SUM
INX B ; Increment location of DATA1
INX H ; Increment location of DATA2
INX D ; Increment location of SUM
LDA COUNT ; Load count in A register
DCR A ; Decrement count value in A register
STA COUNT ; Store count from A register
JNZ LOOP ; Check Zero flag, if it is not set go back to LOOP
HLT ; Stop the execution
Output:
Conclusion:
Quiz:
Suggested Reference:
Good Average Good Average Good Satisfactory Good Satisfactory Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 6
Date: _________________
Design ALU using Logisim.
Competency and Practical Skills: working of ALU, arithmetic and logical operations, concepts
of Digital fundamentals for logic gates, adders, etc.
Objectives:
Equipment/Instruments: Logisim
Explanation:
Conclusion:
Quiz:
Suggested Reference:
Good Average Good Average Good Satisfactory Good Satisfactory Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 7
Date: _________________
Implement Booth’s multiplication algorithm.
Objectives:
Explanation:
Booth algorithm gives a procedure for multiplying binary integers in signed 2’s complement
representation in efficient way, i.e., less number of additions/subtractions required. It operates on
the fact that strings of 0’s in the multiplier require no addition but just shifting and a string of 1’s
in the multiplier from bit weight 2k to weight 2m can be treated as 2(k+1) to 2m. As in all multiplication
schemes, booth algorithm requires examination of the multiplier bits and shifting of the partial
product. Prior to the shifting, the multiplicand may be added to the partial product, subtracted from
the partial product, or left unchanged according to following rules:
1. The multiplicand is subtracted from the partial product upon encountering the first least
significant 1 in a string of 1’s in the multiplier
2. The multiplicand is added to the partial product upon encountering the first 0 (provided that
there was a previous ‘1’) in a string of 0’s in the multiplier.
3. The partial product does not change when the multiplier bit is identical to the previous
multiplier bit.
AC and the appended bit Qn+1 are initially cleared to 0 and the sequence SC is set to a number n
equal to the number of bits in the multiplier.
The next step is to shift right the partial product and the multiplier (including Qn+1). This is an
arithmetic shift right (ashr) operation which AC and QR to the right and leaves the sign bit in AC
unchanged.
The sequence counter is decremented and the computational loop is repeated n times.
Product of negative numbers is important, while multiplying negative numbers we need to find 2’s
complement of the number to change its sign, because it’s easier to add instead of performing binary
subtraction. Product of two negative numbers is demonstrated below along with 2’s complement.
Example – A numerical example of booth’s algorithm is shown below for n = 4. It shows the step
by step multiplication of -5 and -7.
BR = -5 = 1011,
BR'+1 = 0101 <-- 2's Complement (add 1 to the Binary value obtained after 1's complement)
Qn Qn+1 = 10
OPERATION AC QR Qn+1 SC
0 1001 0 4
AC + BR’ + 1 0101 1001 0
ASHR 0010 1100 1 3
AC + BR 1101 1100 1
ASHR 1110 1110 0 2
ASHR 1111 0111 0 1
AC + BR’ + 1 0100 0111 0
ASHR 0010 0011 1 0
Conclusion:
Quiz:
Good Average Good Average Good Satisfactory Good Satisfactory Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)
Rubrics 1 2 3 4 5 Total
Marks
Experiment No: 8
Date: _________________
Study interconnection structures of components of multiprocessor system.
Objectives:
Explanation:
The components that form a multiprocessor system are CPUs, IOPs connected to input output
devices, and a memory unit.
The interconnection between the components can have different physical configurations, depending
on the number of transfer paths that are available
Between the processors and memory in a shared memory system
Among the processing elements in a loosely coupled system
There are several physical forms available for establishing an interconnection network.
Disadvantage:
Only one processor can communicate with the memory or another processor at any given
time.
As a consequence, the total overall transfer rate within the system is limited by the speed of
the single path.
Multiport Memory
A multiport memory system employs separate buses between each memory module and each CPU.
The module must have internal control logic to determine which port will have access to memory
at any given time. Memory access conflicts are resolved by assigning fixed priorities to each
memory port.
Advantage:
The high transfer rate can be achieved because of the multiple paths.
Disadvantage:
It requires expensive memory control logic and a large number of cables and connections.
Crossbar Switch
It consists of a number of cross-points that are placed at intersections between processor buses and
memory module paths. The small square in each cross-point is a switch that determines the path
from a processor to a memory module.
Advantage:
Supports simultaneous transfers from all memory modules.
Disadvantage:
The hardware required to implement the switch can become quite large and complex.
Below fig. shows the functional design of a crossbar switch connected to one memory module.
Using the 2x2 switch as a building block, it is possible to build a multistage network to control the
communication between a number of sources and destinations. To see how this is done, consider
the binary tree shown in Fig. below.
Some request patterns cannot be connected simultaneously. i.e., any two sources cannot be
connected simultaneously to destination 000 and 001. In a tightly coupled multiprocessor system,
the source is a processor and the destination is a memory module. Set up the path → transfer the
address into memory → transfer the data. In a loosely coupled multiprocessor system, both the
source and destination are processing elements.
Hypercube System
The hypercube or binary n-cube multiprocessor structure is a loosely coupled system composed of
N=2n processors interconnected in an n-dimensional binary cube.
Each processor forms a node of the cube, in effect it contains not only a CPU but also local
memory and I/O interface.
Each processor address differs from that of each of its n neighbors by exactly one bit
position.
Fig. below shows the hypercube structure for n=1, 2, and 3.
Routing messages through an n-cube structure may take from one to n links from a source node to
a destination node.
A routing procedure can be developed by computing the exclusive-OR of the source node
address with the destination node address.
The message is then sent along any one of the axes that the resulting binary value will have
1 bits corresponding to the axes on which the two nodes differ.
A representative of the hypercube architecture is the Intel iPSC computer complex.
It consists of 128(n=7) microcomputers, each node consists of a CPU, a floating point
processor, local memory, and serial communication interface units.
Conclusion:
Quiz:
Suggested Reference:
Good Average Good Average Good Satisfactory Good Satisfactory Good Average
(2) (1) (2) (1) (2) (1) (2) (1) (2) (1)
Rubrics 1 2 3 4 5 Total
Marks