sp07quiz4
-
Upload
hardik-prajapati -
Category
Documents
-
view
226 -
download
0
Transcript of sp07quiz4
-
8/7/2019 sp07quiz4
1/4
ECE 2030a Quiz #4 Spring 2007
Name: Student #:
* Closed Book * No Notes * No Calculators *
1. (4 points) Perform each of the following. Write your answer in the box at the right edge.
a. Express the decimal value ( 76) using an 8-bit,
sign-magnitude binary representation.
b. Express the decimal value ( 76) using an 8-bit,2s-complement binary representation.
c. What decimal value corresponds to the 6-bit,2s-complement binary representation 110101 ?
d. What range of values can be represented by an
n-bit 2's-complement binary number?
2. (6 points) Assuming 5-bit 2s-complement integer arithmetic, perform the following binary
additions or subtractions. Write your answers in the boxes provided for each problem andcircle the answers indicating the value of the carry-out bit and whether or not overflow
occurred.
0 1 1 0 1 1 0 1 1 0 1 1 0 1 1
+ 1 1 1 0 1 + 1 0 1 1 1 - 0 1 1 1 0
to
carry-out: 0 1 carry-out: 0 1
overflow: yes no overflow: yes no overflow: yes no
-
8/7/2019 sp07quiz4
2/4
ECE 2030a Quiz #4 Spring 2007
Name: Student #:
* Closed Book * No Notes * No Calculators *
1. (4 points) Perform each of the following. Write your answer in the box at the right edge.
a. Express the decimal value ( 86) using an 8-bit,
sign-magnitude binary representation.
b. Express the decimal value ( 86) using an 8-bit,2s-complement binary representation.
c. What decimal value corresponds to the 6-bit,2s-complement binary representation 101101 ?
d. What range of values can be represented by an
n-bit 2's-complement binary number?
2. 6 points) Assuming 5-bit 2s-complement integer arithmetic, perform the following binary
additions or subtractions. Write your answers in the boxes provided for each problem andcircle the answers indicating the value of the carry-out bit and whether or not overflow
occurred.
1 0 1 1 1 1 1 1 0 1 1 1 0 1 1
+ 1 0 1 1 0 + 0 1 1 0 1 - 0 1 1 0 1
to
carry-out: 0 1 carry-out: 0 1
overflow: yes no overflow: yes no overflow: yes no
-
8/7/2019 sp07quiz4
3/4
ECE 2030a Quiz #4 Spring 2007
Name: SOLUTION Student #:
* Closed Book * No Notes * No Calculators *
1. (4 points) Perform each of the following. Write your answer in the box at the right edge.
e. Express the decimal value ( 76) using an 8-bit,
sign-magnitude binary representation.
10110100
11001100
2n-1
to 2n-1
1
11
f. Express the decimal value ( 76) using an 8-bit,2s-complement binary representation.
g. What decimal value corresponds to the 6-bit,2s-complement binary representation 110101 ?
h. What range of values can be represented by an
n-bit 2's-complement binary number?
2. (6 points) Assuming 5-bit 2s-complement integer arithmetic, perform the following binary
additions or subtractions. Write your answers in the boxes provided for each problem andcircle the answers indicating the value of the carry-out bit and whether or not overflow
occurred.
0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 = 1 1 0 1 1
+ 1 1 1 0 1 + 1 0 1 1 1 - 0 1 1 1 0 + 1 0 0 1 0
0 1 0 1 0 0 1 1 0 1 0 1 1 0 1 0 1 1 0 1
carry-out: 0 1 carry-out: 0 1
overflow: yes no overflow: yes no overflow: yes no
-
8/7/2019 sp07quiz4
4/4