Docsity

Quiz 9 in ECE 2504: Decimal to BCD and IEEE Single Precision Floating Point Conversion - P, Quizzes of Electrical and Electronics Engineering

Toggle sidebar
bg1
Name: ______________________________
SOLUTION
ECE 2504 Introduction to Computer Engineering, Spring 2008
Quiz 9
1. a. (2 pts) Represent the following decimal numbers in signed BCD: 457, 693
b. (2 pts) Perform the given arithmetic: 457 - 693 =
a)
457 ≡ 0000 0100 0101 0111 in signed BCD
693 ≡ 0000 0110 1001 0011 in signed BCD
b)
0000 0100 0101 0111
- 0000 0110 1001 0011
Find the 10’s complement of 693:
9999
– 0693
9306 + 1 = 9307
1
0000 0100 0101 0111
+ 1001 0011 0000 0111
1001 0111 0110 1110
0110
1001 0111 0110 0100
2. (4 pts) The decimal number +0.625 is to be stored in 32-bit IEEE single precision floating point.
Determine the register contents in hexadecimal. Show your work.
.625 × 2 = 1. 25
.25 × 2 = 0.5
.5 × 2 = 1.0
(0.101)2 = 1.01 x 2-1
(-1)S 1.F x 2e
S=0
e=-1; E=-1 + 127 = -126 ≡ (0111 1110)2
F=01000000000000000000000
0 0 1 1 1 1 1 1 0 0 1 0 0
0
0
0
0
0
0
0
0
0
0
0 0 0 0 0
0
0
0
0
3 F 2 0 0 0 0 0

Partial preview of the text

Download Quiz 9 in ECE 2504: Decimal to BCD and IEEE Single Precision Floating Point Conversion - P and more Quizzes Electrical and Electronics Engineering in PDF only on Docsity!

Name: ______________________________ SOLUTION ECE 2504 Introduction to Computer Engineering, Spring 2008 Quiz 9

  1. a. (2 pts) Represent the following decimal numbers in signed BCD: 457, 693 b. (2 pts) Perform the given arithmetic: 457 - 693 =

a) 457 ≡ 0000 0100 0101 0111 in signed BCD 693 ≡ 0000 0110 1001 0011 in signed BCD

b) 0000 0100 0101 0111

  • 0000 0110 1001 0011

Find the 10’s complement of 693: 9999

  • 0693 9306 + 1 = 9307 1 0000 0100 0101 0111
  • 1001 0011 0000 0111 1001 0111 0110 1110 0110 1001 0111 0110 0100
  1. (4 pts) The decimal number +0.625 is to be stored in 32-bit IEEE single precision floating point. Determine the register contents in hexadecimal. Show your work.

.625 × 2 = 1. 25 .25 × 2 = 0. .5 × 2 = 1.

(0.101) 2 = 1.01 x 2- (-1) S^ 1.F x 2 e

S= e=-1; E=-1 + 127 = -126 ≡ (0111 1110 ) 2 F=

0 0 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 F 2 0 0 0 0 0