You are on page 1of 10

CMPSC 3613Computer Architecture

All answers MUST be written in YOUR OWN words, do not just copy-paste from the
slides or other sources. Write your answers immediately after the question and before
the next question.

1. Briefly discuss computer architecture and computer organization and how they relate
to each other. – 6 points.

A computer organization is to expresses the realization of architecture. OR how the


features are implemented like the registers, those data paths (or) this connection to the
memory. contents of the Computer Organization are Arithmetic Logic Unit, Central
Processing Unit & memory and memory organizations.
Computer Architecture is mainly deals with the functionality of the computer and tells
about the structure and behavior of the system to the user. Mainly used in high level
design cases and includes the formats and instructions techniques. It is also called as
micro architecture design and tells what the computer is going to do. It also deals with
addressing modes. Instruction set, addressing modes and data types are comes under
computer architecture.

2. Draw a simple diagram of a computer system based on the Von Neumann architecture.
Make sure to label the components. – 10 points.

ALU

Instruction Control Data


memory unit Memory

I/O

1
3. In reference to computer architecture, what is a register? – 4 points.

It has shift register. Shift registers structure a significant class of parts in a wide range of
advanced circuits. Since the flip-flop output is changed simply by a clock beat after the
info has been changed, the evacuation of clock beats, leaving just the flexibly voltage
present, leaves the yield of the flip-flop unaltered.

4. Briefly explain some of the differences between Von Neumann Architecture and
Harvard Architecture. – 6 points.

Von Neumann Architecture Harvard Architecture

1. Uses a single common physical Uses different memory addresses for


memory for both, instructions and data and instructions
data

2. To execute an instruction, two Only one cycle of processor is needed


clock cycles of processor is needed. to complete an instruction

Development cost of control unit for


3. Development of control unit two buses is more as well as it is more
design is both, simpler and cheaper. complicated

4. Data cannot be transferred and Both data transfers and instruction


instruction cannot be fetched fetching can be performed at the same
simultaneously. time

Microcontrollers and signal processing


5. PCs, laptops and workstations use this
use this

5. Explain what the clock is and its role in electronic circuits. – 6 points.

We are regularly using personal computers, video camera , video games and cellular phones
which is having internal electronics clock to generate the internal clock signal so that particular
device works properly. Here in this all systems clock signal is used to provide the synchronized
pulse between the different activity. clocks controls the timing in the circuit. it controls all of the
logic and arithmetic operations. but the fact is this will affect the speed of a computer because
the gates need to wait for the clock to change from low state to high state or vice versa.
If we are not using clock signal here then gates will change whenever we provide any command
so to provide the efficient results need to use clock signal inside the devices.

2
6. What is RTL? Provide a basic example of an operation in the notation and explain it. – 5
points.

RTL refers to the register transfer level representation of a program necessary to


implement it in logic.
Ex: SUB R1, R2 R1 <- R1 - R2
Ex: Evaluate : Z = (A - B) + C
MOV R1, A R1 <- M[A]
SUB R1, B R1 <- R1 - M[B]
ADD R1, C R1 <- R1 * M[C]
MOV Z, R1 M[Z] <- R1

7. What cycle is repeatedly executed by the CPU? Give the name and provide an
explanation. – 8 points.

For CPU(A)

Execution time For CPU(A) is = Cycle of 2M instruction of CPU(A) * CYCLE time of(A)

= 5 * 10^6 cycles * 60ns = 0.300 sec

Now ,For CPU(B)

Execution time For CPU(B) is = Cycle of 2M instruction of CPU(B) * CYCLE time of(B)

= 3 * 10^6 cycles * 75 ns = 0'225 sec

As We can see That CPU(B) taking less execution time compared to CPU(A)

So, CPU(B) is faster

8. Explain the memory access hierarchy (you can draw a diagram if you wish). – 4 points.

First memory is divided into 2 types:

1-primary memory-volatile in nature ex-RAM

2-secondary memory-parmanent storage. Ex hardisk

3
Primary memory works faster than the secondary memory and data is stored temporarily it it
so also called as temporary memory or volatile memory.

Some types the faster storage than Primary memory is required we use cache memory which
is faster than RAM.

9. In reference to computing, what is a bus? – 3 points.

Having multiple completely different buses offered provides you a lot of selections for
connecting devices to your pc, as hardware manufacturers could supply constant
element for quite one bus sort. as an
example, most desktop PCs use the Serial Advanced Technology Attachment interface for
internal onerous drives, however several external onerous drives and flash drives
connect via USB. If your computer's SATA connections area unit all used, the USB
interface allows you to connect extra storage devices.

10. How many binary sequences are there of length n? – 2 points.

There were 2^n binary sequences. Since, at each position of the string there can only be
two possibilities, i.e., 0 or 1. Therefore, the total number of permutation of 0 and 1 in a
string of length N is given by 2*2*2*… (N times), i.e., 2^N.

11. Show how you would do the following sum in binary (make sure to convert to binary first
and give the result in both binary and base 10): 63+125. -6 points.

63 = 111111
125 = 1111101
Sum = 111111 + 1111101 = 010111100

12. What is two’s complement and why is it used? – 4 points.

Two's complement is a mathematical operation on binary numbers, and is a case of a


radix complement. It is utilized in processing as a technique for marked number
portrayal. The two's supplement of a N-cycle number is characterized as its complement
as for 2N; the total of a number and its two's complement is 2N.

13. What is the two’s complement of: 00110101? – 3 points.

4
110101
5 4 3 2 1 0
¿>1 x 2 +1 x 2 + 0 x 2 +1 x 2 + 0 x 2 +1 x 2
¿>1 x 32+1 x 16+ 0 x 8+1 x 4 +0 x 2+1 x 1
¿>32+16+ 0+4 +0+1
¿>53

14. Carry out the following calculation using 8-bit signed arithmetic (convert to 8-bit binary
sequences) and use two’s complement for the negative number, give the result as both
an 8-bit binary sequence and in base 10: 127 – 74. – 8 points.

Let us do divide 127 successively by 2 until the quotient is 0


> 127/2 = 63, remainder is 1
> 63/2 = 31, remainder is 1
> 31/2 = 15, remainder is 1
> 15/2 = 7, remainder is 1
> 7/2 = 3, remainder is 1
> 3/2 = 1, remainder is 1
> 1/2 = 0, remainder is 1

127 of decimal is 1111111 in binary


127 in 2's complement binary is 01111111
Number: -74
Divide 74 successively by 2 until the quotient is 0
> 74/2 = 37, remainder is 0
> 37/2 = 18, remainder is 1
> 18/2 = 9, remainder is 0
> 9/2 = 4, remainder is 1
> 4/2 = 2, remainder is 0
> 2/2 = 1, remainder is 0
> 1/2 = 0, remainder is 1
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
01001010 is flipped to 10110101
Step 3:. Add 1 to above result
10110101 + 1 = 10110110
so, -74 in 2's complement binary is 10110110

Adding 01111111 and 10110110 in binary


01111111
5
10110110
-------------
(1)00110101
-------------

Verification:
---------------
sum = 00110101
Converting 110101 to decimal
110101
=> 1x2^5+1x2^4+0x2^3+1x2^2+0x2^1+1x2^0
=> 1x32+1x16+0x8+1x4+0x2+1x1
=> 32+16+0+4+0+1
=> 53
verify that 127+-74 = 53: no overflow.

15. What does shifting a binary sequence to left by 3 places correspond to (from the
arithmetic standpoint)? – 3 points.

This is will multiplies the number by 2^n and by shifting by 3 bits, this will multiples the
number by 8.

16. Show that the following are equivalent Boolean expressions: - 6 points
NOT( A AND B AND C)
NOT(A) OR NOT(B) OR NOT(C)

A B C ABC A B C A+ B+C

6
0 0 0 1 1 1 1 1
0 0 1 1 1 1 0 1
0 1 0 1 1 0 1 1
0 1 1 1 1 0 0 1
1 0 0 1 0 1 1 1
1 0 1 1 0 1 0 1
1 1 0 1 0 0 1 1
1 1 1 1 0 0 0 0

17. Draw the circuit symbols for the following gates (assume 2 inputs): AND, OR, NAND. – 6
points.

AND:

0/P = A- B

OR:

A
B 0/P = A + B

NAND:

A
B 0/P = AB = A + B

7
18. Draw the circuit for a two-bit half adder. – 4 points.

19. Discuss sequential circuits vs. combinational circuits (specifically the difference between
the two) and specify the main 3 flip-flops presented during lectures. – 4 points.

Circuits like half adder, full adder, multiplexer are combinational circuits and they do not
depend on previous input to get the output whereas Flip flops, registers are sequential
circuits and they depend on clock cycle as well as previous and past inputs to generate
outputs.

8
20. How would you specify the instruction to add two variables (located in address A and B
respectively) and store it in address C using the assembly language presented in class?
Use the three-address format. -2 points.

Answer:

INPUT
STORE C //Enter the number of numbers
LOOP, CLEAR
LOAD C // C is the number of numbers we are entering
OUTPUT // Displays the number of remaining entries
SUBT B //B is 1, the value we subtract from the count C each loop
STORE C
INPUT // inputs the number to be added
STORE D // number is XXXXX in D
OUTPUT // Display the number entered
SKIPCOND 800 // if the number is > 0 we skip the next instruction
JUMP NOADD // jump to NOADD if the number is XXXXX > 0
ADD A //Add the number to A
STORE A // Store the number back in A
NOADD, LOAD A // load A into the accumulator
OUTPUT //Display the total
LOAD C // load the accumulator with the counter value from C
SKIPCOND 400 if it is not equal to 0 jump to the loop label
JUMP LOOP

Extra Credit

E1 – (bonus 3 points):What were the 3 different instruction types discussed in class?

9
E2 – (bonus 2 points):What is CISC? What is RISC?

10

You might also like