Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Assuming integers are represented as 16-bit words and negative numbers are re

ID: 3664001 • Letter: 1

Question

1) Assuming integers are represented as 16-bit words and negative numbers are represented using the 2's complimentary method, convert the following hexadecimal numbers to decimal numbers (show your work).

a. DADE, b. BFF

2) Assuming integers are represented as 32-bit words and negative numbers are represented using the 2's complimentary method  convert the following decimal numbers to hexadecimal numbers (show your work).

a. -1923, b. 2019

3) Represent following floating point numbers in IEEE single-precision (32-bit) format:

a. -0.4375, b. 0.9375

Show the steps done to reach the answer for each (i.e. how to get the S-bit, the exponent, and the fraction field of the answer).

4) What is the decimal value of the following IEEE single-precision (32-bit) floating point numbers (which are shown in hexadecimal)?

a. 3E000000, b. BF000000

Show the steps done to reach the answer for each.

Explanation / Answer

1) Assuming integers are represented as 16-bit words and negative numbers are represented
using the 2's complimentary method, convert the following hexadecimal numbers to decimal numbers (show your work).

a. DADE, b. BFF

To convert hexadecimal number to decimal number.. We need to use the power of 16 because we know hexadecimal number means number with base 16.

let us take example first.
A. DADE

To convert it in to decimal we have to take decimal values of every digit in Hex number.To understand Hex to decimal converter please see below table
Hexadecimal   Decimal
0           0
1           1
2           2
3           3
4           4
5           5
6           6
7           7
8           8
9           9
A           10
B           11
C           12
D           13
E           14
F           15

step1: Replace every character of hex to its decimal value
DADE= 13 10 13 14

Step2: starting from rightmost bit and start multiply every character to increasing power to 16 starting from 16^0.
DADE= D*16^3+A*16^2+D*16^1+E*16^0
    = 13*4096+10*256+13*16+14*1
   =   56030--> Decimal Value
  
B. BFF

BFF= 11 15 15
   = 11*16^2+15*16^1+15*16^0
   = 3071-->decimal





2). To convert signed decimal number in to hexadecimal we need to first convert it in to binary then from binary to hexadecimal

a. -1923

Step1: It is negative number so first conver original number(positive part) to binary number

1923= 11110000011
to represent it in to 32 bit we append 0 in front
1923=   00000000000000000000011110000011

Step2: but it is negative number so we need to convert it in to 2's complement notation
  
1's complement of 1923= (00000000000000000000011110000011)'
                      = (11111111111111111111100001111100)

now 2's complement = adding 1 to 1's conplement                  
2's complement of 1923= (11111111111111111111100001111100)+1
                      =   11111111111111111111100001111101---> This is how -1923 is represented in two's complement signed binary

Step3: The
final step is to convert the binary to hexadecimal. We simply group the bits into groups of four, then convert each group to its
hexadecimal equivalent
1111 1111 1111 1111 1111 1000 0111 1101    (to convert binary to decimal we follow this rule. eg 1101= 1*2^3+1*2^2+0*2^1+1*2^0)
15    15   15   15   15   8   7     13
F      F     F   F   F     8   7    D
so -1923= FFFFF87D-->Hexadecimal


b. 2019

2019= 0000011111100011

to represent it into 32bit.
2019= 00000000000000000000011111100011

Grouping in to four

2019=0000 0000 0000 0000 0000 0111 1110 0011                    

     = 0    0    0    0    0    7    14   3
   = 000007E3--->Hexadecimal
  
  
  
  
  
  
3) Represent following floating point numbers in IEEE single-precision (32-bit) format:

a. -0.4375, b. 0.9375

a. -0.4375

IEEE single-precision (32-bit) format consist of 3 parts: sign-exponent-mantisa
sign=1 bit
exponent=8 bits
mantisa= 23 bits


step1: convert floatig point number to binary number
0.4375= .4375*2
      = .8750   =   0
  
.8750= .8750*2
       = 1.75 =   1
      
.75= .75*2
   =   1.5 =        1
  
.5=    .5*2
   = 1.0 =           1
  
0.4375= 0.0111 ->converted to a binary number


step2: Converted to normalized binary number in which there must be only 1 digit in left of decimal point.
0.4375= 1.11*2^-3

step3:
The mantissa is positive so the sign S = 0

The biased exponent E is given by E = e + 127
E= -3+127=124 = 01111100 (in 8 bits)

Fractional part of mantissa M:
M= .11000000000000000000000 (in 23 bits)

The IEEE 754 single precision representation is given by:

0 01111100 11000000000000000000000 --> Ans

b: 0.9375

0.9375= 0.1111-> converted to a binary number

0.9375= 1.111 *2^-3 --> normalized

The mantissa is positive so the sign S = 0

The biased exponent E is given by E = e + 127
E= -3+127=124 = 01111100 (in 8 bits)

Fractional part of mantissa M:
M= .11100000000000000000000 (in 23 bits)

The IEEE 754 single precision representation is given by:

0 01111100 11100000000000000000000 --> Ans