Department of Electrical Engineering
Embedded Systems (ELEC366)
Practice Problems: Information Representation in
Embedded Systems
For all questions, show all your work in detail
1.
(a)
Convert the following values into binary using fixed-point format, with 8 bits
for the integer part and 4 bits for the fractional part:
•
•
•
(b)
Convert the following binary fixed-point values written into decimal. They are
written using 8 bits for the integer part and 4 bits for the fractional part:
•
•
•
2.
(a)
-0.25
-0.4375
-0.9375
11111111.0011
10101101.0101
1100010.1001
The sign, exponent, and mantissa of a single-precision floating-point
numbers are as follows. Write their binary and decimal representations:
-
(b)
3.
Sign: negative, e = 120, m = 0.84375
Sign: positive, e = 120, m = 0.84375
Sign: negative, e = 15, m = 0.75
Sign: positive, e = 1, m = 0.0
Sign: positive, e = 127, m = 0.0
Write the first two results from question (a) as a binary fixed-point number using 8
bits for the integer part and 8 bits for the fractional part.
In a C program, a constant K was defined as a float and given a value. After execution, the
constant K is stored in data memory as shown below. Determine the value of K in the C
code.
K 11000101100011110000000000000001
5) a)