Computer Organization and Structure

Homework #3

Due: 2011/11/8

 

1.      Hexadecimal (base 16) is also a commonly used numbering system for representing values in computers. The following table shows pairs of hexadecimal numbers.

 

 

A

B

1

0D34

DD17

2

BA1D

3617

 

a.       What is the sum of A and B if they represent unsigned 16-bit hexadecimal numbers? The result should be written in hexadecimal. Show your work.

b.      What is the sum of A and B if they represent signed 16-bit hexadecimal numbers stored in sign-magnitude format? The result should be written in hexadecimal. Show your work.

c.       Convert A into a decimal number, assuming it is unsigned. Repeat assuming it stored in sign-magnitude format. Show your work.

 

The following table also shows pars of hexadecimal numbers.

 

 

A

B

1

BA7C

241A

2

AADF

47BE

 

d.      What is A - B if they represent unsigned 16-bit hexadecimal numbers? The result should be written in o hexadecimal. Show your work.

e.       What is A - B if they represent signed 16-bit hexadecimal numbers stored in sign-magnitude format? The result should be written in hexadecimal. Show your work.

f.       Convert A into a binary number. What makes base 16 (hexadecimal) an attractive numbering system for representing values in computers.

 

2.      Let’s look in more detail at multiplication. We will use the numbers in the following table.

説明: f03-04-P374493

 

A

B

1

50

23

2

66

04

 

a.       Using a table similar to the following one, calculate the product of the octal unsigned 6-bit integers A and B using the hardware as shown in the right figure. You should show the contents of each register on each step.

 

Iteration

Step

Multiplier

Multiplicand

Product

0

Initial values

0011

0000 0010

0000 0000

1

1a: 1ÞProd=Prod+Mcand

0011

0000 0010

0000 0010

2: Shift left Multiplicand

0011

0000 0100

0000 0010

3: Shift right Multiplier

0001

0000 0100

0000 0010

2

1a: 1ÞProd=Prod+Mcand

0001

0000 0100

0000 0110

2: Shift left Multiplicand

0001

0000 1000

0000 0110

3: Shift right Multiplier

0000

0000 1000

0000 0110

3

1: 0ÞNo operation

0000

0000 1000

0000 0110

2: Shift left Multiplicand

0000

0001 0000

0000 0110

3: Shift right Multiplier

0000

0001 0000

0000 0110

4

1: 0ÞNo operation

0000

0001 0000

0000 0110

2: Shift left Multiplicand

0000

0010 0000

0000 0110

3: Shift right Multiplier

0000

0010 0000

0000 0110

説明: f03-06-P374493

b.      Using a table similar to the above one, calculate the product of the hexadecimal unsigned 8-bit integers A and B using the hardware as shown in the right figure. You should show the contents of each register on each step.

 

3.      In a Von Neumann architecture, groups of bits have no intrinsic meanings by themselves. What a bit pattern represents depends entirely on how it is used. The following table shows bit patterns expressed in hexadecimal notation.

 

1

0x24A60004

2

0xAFBF0000

 

a.       What decimal number does the bit pattern represent if it is a two’s-complement integer? An unsigned integer?

b.      If this bit pattern is placed into the Instruction Register, what MIPS instruction will be executed?

c.       What decimal number does the bit pattern represent if it is a floating point number? Use the IEEE 754 standard.

 

The following table shows decimal numbers.

 

1

-1609.5

2

-983.8125

 

d.      Write down the binary representation of the decimal number, assuming the IEEE 754 single precision format.

e.       Write down the binary representation of the decimal number, assuming the IEEE 754 double precision format.

f.       Write down the binary representation of the decimal number, assuming it was stored using the single precision IBM format (base 16, instead of base 2, with 7 bits of exponent).

 

4.      Show a truth table for a multiplexor (inputs A, B, and S; output C), using don’t cares to simplify the table where possible.