Starting from:

$25

CS1400-Homework 2 Binary Codes and Arithmetic Solved

Fixed Point Codes:
 

1.1. Convert  512(8) into 32-bit two’s complement binary number.

 

1.2. Convert  -512(10) into 32-bit two’s complement binary number.

 

1.3.Convert  -87E524(16) into 32-bit two’s complement binary number.

 

1.4.  Represent following numbers 517(10) , - 2048(8) , -4A9D(16) in :

®     Binary sign magnitude code;

 

®     Binary two’s complement code.

 

 

Remark: Use half word (16-bits) to present the binary numbers.

 

 

2.      Fixed Point Arithmetic
 

2.1.  What decimal number does this two’s complement binary number represent:

   11111111 11011011

2.2.  What decimal number does this two’s complement binary number represent:

   11111111 11111111

2.3.  What decimal number does this two’s complement binary number represent (present the answer in scientific notation):

   01111111 11111111

 

 

2.4.  Present the following binary numbers in Excess 127 and Excess 1023 code:  1001, -100011, -100101.

 

2.5   Perform the following operations, representing the decimal numbers in 8-bit two’s complement code. Fill in the flags C, N, Z, V. If the operations produce arithmetic overflow, eExplain how you have estimated the overflow.

 

20 – (+5);     127 + (–126);   127 + (– 128); 

 -20 + (+ 64);    -20 – (+111);     -127 – (+ 2);      - 126 + (– 2).

More products