Docsity

Integer Representation - Computer Engineering - Solved Exam, Exams of Computer Science

Toggle sidebar
bg1
ECE 2030 G Computer Engineering Spring 2002
4 problems, 6 pages Exam Two Solutions 21 March 2001
1
Problem 1 ( parts, 35 points) Numbers and Arithmetic
Part A (4 points) Convert these binary values (and powers of two) into decimal notation:
binary notation decimal notation
101101.11 45.75
218 256K
Part B (2 points) Convert this decimal value into hexidecimal notation:
decimal notation hexadecimal notation
91 0x5B
Part C (4 points) Convert the following hexadecimal values into octal notation:
hexadecimal notation octal notation
0x9C3 4703
0x5E.2 136.1
Part D (9 points) For each problem below, (a) compute the addition or subtraction using the
rules of arithmetic (note that the third problem is a subtraction), (b) indicate whether an error
occurs assuming all numbers are expressed using a four bit two’s complement representation,
and (c) indicate whether an error occurs assuming all numbers are expressed using a four bit
unsigned representation.
1 1
+ 1 1 0 1
1 1 0 0
+ 1 1 0
1 0 0 1
- 1 1 1 1
result 0 0 0 0 0 0 1 0 1 0 1 0
signed
error? No No No
unsigned
error? Yes Yes Yes
pf3
pf4
pf5

Partial preview of the text

Download Integer Representation - Computer Engineering - Solved Exam and more Exams Computer Science in PDF only on Docsity!

4 problems, 6 pages Exam Two Solutions 21 March 2001

Problem 1 ( parts, 35 points) Numbers and Arithmetic

Part A (4 points) Convert these binary values (and powers of two) into decimal notation:

binary notation decimal notation 101101.11 45.

218 256K

Part B (2 points) Convert this decimal value into hexidecimal notation:

decimal notation hexadecimal notation 91 0x5B

Part C (4 points) Convert the following hexadecimal values into octal notation:

hexadecimal notation octal notation

0x9C3 4703

0x5E.2 (^) 136.

Part D (9 points) For each problem below, (a) compute the addition or subtraction using the rules of arithmetic (note that the third problem is a subtraction) , (b) indicate whether an error occurs assuming all numbers are expressed using a four bit two’s complement representation, and (c) indicate whether an error occurs assuming all numbers are expressed using a four bit unsigned representation.

  • 1 1 1 1

result 0 0 0 0^ 0 0 1 0^ 1 0 1 0

signed

error? No^ No^ No

unsigned

error? Yes^ Yes^ Yes

4 problems, 6 pages Exam Two Solutions 21 March 2001

Part E (4 points) What is the minimum number of bits needed to represent the following decimal integers in an unsigned integer representation?

a) 3387: 12 bits.

b) 64: 7 bits.

Part F (4 points) What is the minimum number of bits needed to represent the following decimal integers in a signed two’s complement integer representation?

a) 3387: 13 bits.

b) negative sixty-four: 7 bits.

Part G (8 points) Complete the truth table below for a full subtractor.

A B Borrowin Borrowout Difference

0 0 0 0 0

1 0 0 0 1

0 1 0 1 1

(^1 1 0) 0 0

0 0 1 1 1

1 0 1 0 0

0 1 1 1 0

1 1 1 1 1

4 problems, 6 pages Exam Two Solutions 21 March 2001

O 0

O 1

Ext Clr

Ext CE TE Out Clr

TE Out Clr

O 0

O 1

Ext Clr

Ext CE TEOut Clr

TEOut Clr

OR

4 problems, 6 pages Exam Two Solutions 21 March 2001

Problem 3 (3 parts, 20 points) State Machines

Out In register

A

Out In register

S S

O

O

Part A (8 points) Complete the state table for the state machine shown above. A S 1 S 0 O 1 O 0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0

Part B (10 points) Complete the state diagram below for this device by adding all required transition arcs with input annotations. Output annotations are not required since they correspond to the new state.

state 00

state 01

state 10

A

A

A

A

A A

A

A

Part C (2 points) In 6 words or less, describe the function this device implements.

2-bit nonsaturating up/down counter