Sie sind auf Seite 1von 3

# KT14203- Computer Architecture and Organization

## Sekolah Kejuruteraan dan Teknologi Maklumat

QUIZ #5

1. Given x = -7 and y = -5. Find the twos complement notation of x and y, then
compute the product x x y with Booths Algorithm using 4-bit words.
(11 marks)

Answer:

X = -7 = 0111=1000+1=1001=M [1]
Y= -5 = 0101=1010+1 =1011= Q [1]
A Q Q-1 M
0000 1011 0 1001 Initial [1]
0111 1011 0 0+0111 Subtract [1]
0011 1101 1 Shift [1]
0001 1110 1 Shift [1]
1010 1110 1 0001+1001 Add [1]
1101 0111 0 Shift [1]
0100 0111 0 1101+0111 Subtract [1]
0010 0011 1 Shift [1]

## Semester 2 2013/2014 Page 1

KT14203- Computer Architecture and Organization

## 2. Consider a hypothetical machine as depicted in Figure 1. Table 1

lists the opcodes (in hexadecimal) for your machine.
(9 marks)

opcode address
1 Load AC from memory
0 7 23 5 Subtract AC from memory
2 Store AC to memory
magnitude Table 1
0 1 23

## Instruction and integer format

Figure 1
Show the program execution (step by step) based on Figure 2.

PC
1500
1500 014002

AC
1501 054003
IR
1502 024001

: :

4001 000000

00000A
4002

00000F
4003

Figure 2

## Semester 2 2013/2014 Page 2

KT14203- Computer Architecture and Organization

Answer:

Step 1 Step 2

Step 3 Step 4

Step 5 Step 6