Data Representation — Question 6
Back to all questionsQuestion 6
Convert the following binary numbers to decimal and hexadecimal:
(a) 1010
(b) 111010
(c) 101011111
(d) 1100
(e) 10010101
(f) 11011100
(a) 1010
Converting to decimal:
| Binary No | Power | Value | Result |
|---|---|---|---|
| 0 (LSB) | 20 | 1 | 0x1=0 |
| 1 | 21 | 2 | 1x2=2 |
| 0 | 22 | 4 | 0x4=0 |
| 1 (MSB) | 23 | 8 | 1x8=8 |
Equivalent decimal number = 8 + 2 = 10
Therefore, (1010)2 = (10)10
Converting to hexadecimal:
Grouping in bits of 4:
| Binary Number | Equivalent Hexadecimal |
|---|---|
| 1010 | A (10) |
Therefore, (1010)2 = (A)16
(b) 111010
Converting to decimal:
| Binary No | Power | Value | Result |
|---|---|---|---|
| 0 (LSB) | 20 | 1 | 0x1=0 |
| 1 | 21 | 2 | 1x2=2 |
| 0 | 22 | 4 | 0x4=0 |
| 1 | 23 | 8 | 1x8=8 |
| 1 | 24 | 16 | 1x16=16 |
| 1 (MSB) | 25 | 32 | 1x32=32 |
Equivalent decimal number = 32 + 16 + 8 + 2 = 58
Therefore, (111010)2 = (58)10
Converting to hexadecimal:
Grouping in bits of 4:
| Binary Number | Equivalent Hexadecimal |
|---|---|
| 1010 | A (10) |
| 0011 | 3 |
Therefore, (111010)2 = (3A)16
(c) 101011111
Converting to decimal:
| Binary No | Power | Value | Result |
|---|---|---|---|
| 1 (LSB) | 20 | 1 | 1x1=1 |
| 1 | 21 | 2 | 1x2=2 |
| 1 | 22 | 4 | 1x4=4 |
| 1 | 23 | 8 | 1x8=8 |
| 1 | 24 | 16 | 1x16=16 |
| 0 | 25 | 32 | 0x32=0 |
| 1 | 26 | 64 | 1x64=64 |
| 0 | 27 | 128 | 0x128=0 |
| 1 (MSB) | 28 | 256 | 1x256=256 |
Equivalent decimal number = 256 + 64 + 16 + 8 + 4 + 2 + 1 = 351
Therefore, (101011111)2 = (351)10
Converting to hexadecimal:
Grouping in bits of 4:
| Binary Number | Equivalent Hexadecimal |
|---|---|
| 1111 | F (15) |
| 0101 | 5 |
| 0001 | 1 |
Therefore, (101011111)2 = (15F)16
(d) 1100
Converting to decimal:
| Binary No | Power | Value | Result |
|---|---|---|---|
| 0 (LSB) | 20 | 1 | 0x1=0 |
| 0 | 21 | 2 | 0x2=0 |
| 1 | 22 | 4 | 1x4=4 |
| 1 (MSB) | 23 | 8 | 1x8=8 |
Equivalent decimal number = 8 + 4 = 12
Therefore, (1100)2 = (12)10
Converting to hexadecimal:
Grouping in bits of 4:
| Binary Number | Equivalent Hexadecimal |
|---|---|
| 1100 | C (12) |
Therefore, (1100)2 = (C)16
(e) 10010101
Converting to decimal:
| Binary No | Power | Value | Result |
|---|---|---|---|
| 1 (LSB) | 20 | 1 | 1x1=1 |
| 0 | 21 | 2 | 0x2=0 |
| 1 | 22 | 4 | 1x4=4 |
| 0 | 23 | 8 | 0x8=0 |
| 1 | 24 | 16 | 1x16=16 |
| 0 | 25 | 32 | 0x32=0 |
| 0 | 26 | 64 | 0x64=0 |
| 1 (MSB) | 27 | 128 | 1x128=128 |
Equivalent decimal number = 1 + 4 + 16 + 128 = 149
Therefore, (10010101)2 = (149)10
Converting to hexadecimal:
Grouping in bits of 4:
| Binary Number | Equivalent Hexadecimal |
|---|---|
| 0101 | 5 |
| 1001 | 9 |
Therefore, (101011111)2 = (95)16
(f) 11011100
Converting to decimal:
| Binary No | Power | Value | Result |
|---|---|---|---|
| 0 (LSB) | 20 | 1 | 0x1=0 |
| 0 | 21 | 2 | 0x2=0 |
| 1 | 22 | 4 | 1x4=4 |
| 1 | 23 | 8 | 1x8=8 |
| 1 | 24 | 16 | 1x16=16 |
| 0 | 25 | 32 | 0x32=0 |
| 1 | 26 | 64 | 1x64=64 |
| 1 (MSB) | 27 | 128 | 1x128=128 |
Equivalent decimal number = 4 + 8 + 16 + 64 + 128 = 220
Therefore, (11011100)2 = (220)10
Converting to hexadecimal:
Grouping in bits of 4:
| Binary Number | Equivalent Hexadecimal |
|---|---|
| 1100 | C (12) |
| 1101 | D (13) |
Therefore, (11011100)2 = (DC)16