Coa Mid
Coa Mid
Coa Mid
MEKELLE UNIVERSITY
ኢን ስ ቲ ቱ ት ቴ ክ ኖ ሎ ጂ መቐለ
MEKELLEINSTITUTE OF TECHNOLOGY
Weight 30%
Instructions
Make sure 2 pages
Cheating in exam is forbidden
CPU is executing programs through fetch decode execute cycle. To makes the program
execution faster CPU can has multitasking principle that while the first instruction is
executing the next instruction will be loaded (fetched from memory).
2) Explain the differences between vonNeumann versus Harvard architecture. Sketch diagrams for
each of these structures.
The abandon architecture vonneuman is when the data and address buses are connected in
the same line of transfer but with scheduling transfer.
Harvard architecture notices that data and address buss are in separate line of connections
so that data and address will be transferred at the same time
Bus is a path (of a group of wires) over which information is transferred, from any of several
sources to any of several destinations. Transfer will be possible From a register to bus or
among registers: BUS R
For simplicity Answer sheet, The decimal number 243435 is 18 bit number as follows = 11 1011
0110 1110 1011
If size of data bus is 16 bit, this implies that 16 bit data will be transferred from memory to CPU
(registers) at once (clock time of the processor).
Hence, it is expected to say that the other two bits of the decimal number above will be
stored/read in the next instruction call.
Unfortunate due to size of integer data size is 8 bits here, the maximum integer number we can
accept in java is 28=256. The integer number we gave to java compiler will run overflow error.
2) Let you have calculator application in your system. You let open the application and you type
2+7
= 9. Answer the following Questions
i. Explain what is function of Operating system here
ii. Explain what is function of CPU here
iii. Explain what is the function of RAM here
OS is a system program in our computer that manages every hardware and software
resources. OS allows application programs to run over it. Here, CALCULATOR
application with its Graphical user interface/view and set of active buttons is developed
and then installed as part of the OS.
CPU is worker of OS that it will call by OS as one resource. To execute the addition of
2+7, CPU would use through ALU and CU.
RAM will load/read and store/write the result executed by CPU ALU, CU, and registers.
Here, one register stores value 2, another register stores value 7. The result/sum is stored
in Accumulator register by default. And then the value will transfer to RAM to display in
calculator Application.
Register is a small storage device that stores bits of data for operation. Registers can be
special and general purpose registers. Instructions are software commands that order the
CPU to do some operations. Instructions enable value of registers to be adjusted
accordingly. For example, ADD B is 8085uP instruction that adds contents of register A
and register B and then store the result in register A.
ii. Describe and list what are general and specific purpose registers.
GP Registers: will function on usual arithmetical and logical operations made by CPU.
Examples Accumulator (A/ACC), BC, HL, DE, etc
SP Registers: will function and called on some special purpose activities by CPU.
Examples MAR< MDR, IR, IRR, PC, SP (stack pointer)
iii. What would be value of MAR and MDR based on the above code
Hence, in this example once the PC (program counter register holds address of execution
instructions sequentially, IR holds each of above sequential instructions their address is
hold by PC.
s.N B1 B2 B3 B4 OP CL
0 0 0 0 0 0 1
1 0 0 0 1 0 1
2 0 0 1 0 0 1
3 0 0 1 1 0 1
4 0 1 0 0 0 1
5 0 1 0 1 0 1
6 0 1 1 0 1 0
7 0 1 1 1 1 0
8 1 0 0 0 0 1
9 1 0 0 1 0 1
10 1 0 1 0 0 1
11 1 0 1 1 0 1
12 1 1 0 0 1 0
13 1 1 0 1 1 0
14 1 1 1 0 1 0
15 1 1 1 1 1 0
A 4 bit adder subtractor, means combinational of addition and subtraction for 4 bit values.
The operations of both addition and subtraction can be performed by a one common binary
adder. Such binary circuit can be designed by adding an Ex-OR gate with each full adder as
shown in below figure. The figure below shows the 4 bit parallel binary adder/subtractor
which has two 4 bit inputs as A3A2A1A0 and B3B2B1B0.
The mode input control line M is connected with carry input of the least significant bit of the
full adder. This control line decides the type of operation, whether addition or subtraction.
Cascaded binary adders(4 bit)
When M= 1, the circuit is a subtractor and when M=0, the circuit becomes adder. The Ex-OR
gate consists of two inputs to which one is connected to the B and other to input M. When M
= 0, B Ex-OR of 0 produce B. Then full adders add the B with A with carry input zero and
hence an addition operation is performed.
When M = 1, B Ex-OR of 0 produce B complement and also carry input is 1. Hence the
complemented B inputs are added to A and 1 is added through the input carry, nothing but a
2’s complement operation. Therefore, the subtraction operation is performed.