Answers: Signed Integers

1. Write each of the following signed decimal integers in 8-bit binary notation:

Hint: Remove the sign, create the binary representation of the number, and then convert it to its two's complement.

  
a.
-2 = 11111110
  
e.
+15 = 00001111
b.
-7 = 11111001
  
f.
-1 = 11111111
c.
-128 = 10000000
  
g.
-56 = 11001000
d.
-16 = 11110000
  
h.
+127 = 01111111

 

2. Write each of the following 8-bit signed binary integers in decimal:

Hint: If the highest bit is set, convert the number to its two's complement, create the decimal representation of the number, and then prepend a negative sign to the answer.

  
a.
11111111 = -1 
  
g.
00001111 = +15
b.
11110000 = -16
  
h.
10101111 = -81
c.
10000000 = -128
  
i.
11111100 = -4
d.
10000001 = -127
  
j.
01010101 = +85

 

3. Which of the following integers are valid 16-bit signed decimal integers?

  
a.
+32469 = V
  
d.
+32785 = I
b.
+32767 = V
  
e.
-32785 = I
c.
-32768 = V
  
f.
+65535 = I

 

4. Indicate the sign of each of the following 16-bit hexadecimal integers:

  
a.
7FB9h = P
  
c.
0D000h = N
b.
8123h = N
  
d.
649Fh = P

 

5. Write each of the following signed decimal integers as a 16-bit hexadecimal value:

  
a.
-42 = FFD6h
  
e.
-32768 = 8000h
b.
-127 = FF81h
  
f.
-1 = FFFFh
c.
-4096 = F000h
  
g.
-8193 = DFFFh
d.
-16 = FFF0h
  
h.
-256 = FF00h