Binary Number System in Discrete Mathematics, Exercises of Discrete Mathematics

10 Multiple Choice of Binary Number System.

Typology: Exercises

2021/2022

Uploaded on 02/11/2022

ekadant
ekadant ๐Ÿ‡บ๐Ÿ‡ธ

4.3

(32)

267 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Exercise on Binary Number System
1. How many distinct values can we represent with
a) 4 bits - 16 b)5 bits - 32
2. Add the following unsigned binary numbers
a) 1110 + 111 b) 11011 + 11011
1110
0111
10101
11011
11011
110110
3. What is the largest positive number one can represent in 5-bit 2โ€™s complement code?
25-1 -1 = 15
4. Convert the following from 2โ€™s complement to Decimal
1010
This is a negative number as the most significant bit is 1. Find out its positive
counter by flipping all bits and then adding 1.
0101 + 1 = 0110
= 0 x 23 + 1 x 22 + 1 x 21 + 0 x 20
= 4 + 2 = 6
Hence the number is -6.
5. Convert the following decimal to 8-bit 2โ€™s complement binary numbers.
a) 11 Division Method
11/2 โ€“ remainder 1
5/2 - remainder 1
2/2 -- remainder 0
1/2 โ€“ remainder 1
00001011
b) -128
Subtracting Powers of 2 Method
128 โ€“ 128 = 0 bit 7 should be 1 as 27 = 128
10000000 = 128
Now take 2โ€™s complete to get -128
01111111 + 1 = 10000000
pf2

Partial preview of the text

Download Binary Number System in Discrete Mathematics and more Exercises Discrete Mathematics in PDF only on Docsity!

Exercise on Binary Number System

  1. How many distinct values can we represent with a) 4 bits - 16 b)5 bits - 32
  2. Add the following unsigned binary numbers a) 1110 + 111 b) 11011 + 11011 1110 0111 10101

11011 11011 110110

  1. What is the largest positive number one can represent in 5-bit 2โ€™s complement code? 2 5-1^ -1 = 15
  2. Convert the following from 2โ€™s complement to Decimal 1010 This is a negative number as the most significant bit is 1. Find out its positive counter by flipping all bits and then adding 1. 0101 + 1 = 0110 = 0 x 2^3 + 1 x 2^2 + 1 x 2^1 + 0 x 2^0 = 4 + 2 = 6 Hence the number is -6.
  3. Convert the following decimal to 8-bit 2โ€™s complement binary numbers. a) 11 Division Method 11/2 โ€“ remainder 1 5/2 - remainder 1 2/2 -- remainder 0 1/2 โ€“ remainder 1

00001011

b) - Subtracting Powers of 2 Method

128 โ€“ 128 = 0 bit 7 should be 1 as 2^7 = 128 10000000 = 128 Now take 2โ€™s complete to get - 01111111 + 1 = 10000000

  1. Add the following 2โ€™s complement binary numbers and also express the answer in decimal. 01 + 10011

00001 (+1) 10011 (-13) 10100 (-12)

  1. Compute the following ((NOT 0110) OR 0000) AND 1111 1001 OR 0000 = 1001 1001 AND 1111 = 1001
  2. Does the addition of following 4-bit 2โ€™s complement numbers generate an overflow? Justify your answer. 0111 + 1001

0111 (+ 7) 1001 (- 7) 1 0000 (0) No Overflow (discard the carry), as 7-7 = 0

  1. Convert unsigned binary numbers to hex and octal notation 1110 1101 1011 0010 EDB2 (^16) 166628
  2. Write the decimal equivalents for these IEEE floating point numbers 0 10000011 00000000000000000000000

N = (-1 0 ) x 1.0 x 2131-127= 1.0 x 2^4 =16.