# Number System

#### Chapter 10

5 Steps - 3 Clicks

# Number System

### Introduction

Number systems are the technique to represent numbers in the computer system architecture, every value that you are saving or getting into/from computer memory has a defined number system. A computer can understand only binary numbers (0 and 1).

### Concepts

Computer architecture supports following number systems.

Binary Number System
A Binary number system has only two digits that are 0 and 1. Every number (value) represents with 0 and 1 in this number system. The base of binary number system is 2, because it has only two digits.
Binary system was introduced by Gottfried wilhelm leibniz.

Example:
1 in binary system is represented as 0001
3 in binary system is represented as 0011
$$(1001)_{2}$$ = $$1 * 2^3$$ + $$0 * 2^2$$ + $$0 * 2^1$$ + $$1 * 2^0$$
i.e.8 + 0 + 0 + 1 = 9

One bit is 0 or 1, 4 bits are equal to one nibble and 8 bits is known as one Byte. A single “word” may consist 16 or 32 bits in size. Floating point arithmetic is used to represent real numbers, fractions and large numbers.

Name Size
1 bit Single digit 0 or 1
1 nibble 4 bits
1 byte 8 bits
1 Kilobyte(KB) 1024 Bytes
1 Megabyte(MB) 1024 KB
1 Gigabyte(GB) 1,024 MB
1 Terabyte(TB) 1,024 GB
1 Petabyte (PB) 1,024 TB
1 Exabyte (EB) 1,024 PB

Decimal Number System
Decimal Number System is a general number system that consists ten digits from 0 to 9. Any numeric value can be represented by using these numbers. It is also called as base-10 or positional number system.

Example:
$$3 * 10^2$$ + $$5 * 10^1$$ + $$6 * 2^0$$ = $$(356)_{10}$$

Octal Number System
Octal Number system is also known as Base 8 system and consists 8 digits from 0 to 7. It is represented in the power of 8. It is a shorter number System.

Example:
$$(21)_{8}$$ = $$2 * 8^1$$ + $$1 * 8^0$$ = 16 + 1 = 17

Representation of Octal Numbers in Binary:

Octal Binary Digits
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111

It is a shorthand method of working with binary numbers. It is also called as a base -16 system or Hex. This system consists of 16 digits from 0 to 9 and A to F. A denotes 10, B denotes 11, C denotes 12, D denotes 13, E denotes 14 and f denote 15. It is represented in the power of 16.

Example:
$$(21)_{16}$$ = 21H = $$2 * 16^1$$ + $$1 * 16^0$$ = 2 × 16 + 1 = 33

0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111

Conversion between the Number systems

Decimal to Binary:

1. Divide the given decimal number by 2.

2. The remainder should be 0 or 1, note the quotient and remainder.

3. If the quotient is not 0, then again divide by 2 until the quotient=0 and then stop the process.

4. The first remainder is called as Least Significant bit and the last remainder is known as the Most Significant bit.

5. The remainders will be arranged from last remainder bit to the first remainder bit.

Example: $$(56)_{10}$$ =

Remainder
2 56
2 28 0 → LSD
2 14 0
2 7 0
2 3 1
1 1 → MSB

Binary to Decimal

1. In this, multiply binary digit with the powers of 2.

2. For an integral part, the power will be positive and negative for the fractional part.

3. Finally, add those multiplying digits.

Example: $$(1110.10)_{2}$$ = ?
$$1 * 2^3$$ + $$1 * 2^2$$ + $$1 * 2^1$$ + $$1 * 2^0$$ + $$1 * 2^{-1}$$ + $$0 * 2^{-2}$$
= 8 + 4 + 2 + 0 + 0.5 + 0 = $$(14.5)_{10}$$

Binary to Octal

1. Separate the given number into a group of three bits from right to left

2. Convert each group to a decimal number.

Example: $$(110010)_{2}$$ = ?
= (110)(010)
= (6)(2) = $$62_{8}$$

Octal to Binary

1.This is completely opposite to binary to octal.

2. Convert every digit of the number from octal to binary in the group of three bits.

Example: $$(534.2)_{8}$$ = ?
= 5 → 101 3 → 011 4 → 100 2 → 010
= $$(101011100.010)_{2}$$

1.In this, the binary code will be split into four-bit group from right to left.

2. Then each group will be converted into decimal numbers.

Example: $$(10100011)){2}$$ = ?
= 1010 → A 0011 → 3
= $$(A3)_{16}$$

Conversion of hexadecimal digital to binary digit.

Example: $$(AF62)_{16}$$ = ?
= A → 1010 F → 1111
6 → 0110 2 → 0010
= $$(1010111101100010)_{2}$$

Decimal to octal

1. The given number is divided by 8.

2. The remainder will be 0 to 7. Note the quotient and remainder.

3. This process will be running until the quotient=0.

4. Note the each remainder from left to right.

Example: $$(65621)_{10}$$ = ?

Remainder
8 65621 5 → LSD
8 8202 2
8 1025 1
8 128 0
8 16 0
8 2 2 → MSB

$$(65621)_{10}$$ = $$(200125)_{8}$$

Octal to Decimal

1. Multiply the given number with the power of 8.

2. For an integral part, the power will be positive and negative for the fractional part.

Example: $$653_{8}$$ = ?
= $$6 * 8^2$$ + $$5 * 8^1$$ + $$3 * 8^0$$
= 384 + 40 + 3 = $$(427)_{10}$$

1.The given number should be divided by 16

2. The digits of remainders will be 0 to 9 and A to F

3. The process of division should be run until the quotient=0 or less than 16.

4. Each remainder can be written from left to right.

Example: $$(943562)_{10}$$ = ?

Remainder
16 943562 A → LSD
16 58972 C
16 3685 5
16 230 6
16 14 E → MSD

= $$(943562)_{10}$$ = $$(E65CA)_{16}$$

1. Multiply each digit with the power of 16.

2. The power should be positive for an integral part.

3. Add all the multiplying digits.

Example: $$(AE12C)_{16}$$ = ?
= $$10 * 16^4$$ + $$14 * 16^3$$ + $$1 * 16^2$$ + $$2 * 16^1$$ + $$12 * 16^0$$
= $$(71004)_{10}$$

1.The conversion of octal to hexadecimal is not possible directly, so first convert each digit of octal number to binary.

2. Again convert it into hexadecimal from right to left.

Example: $$(76224)_{8}$$=?
7 → 111 6 → 110
2 → 010 4 → 100
=$$(111110010010100)_{2}$$
=0111 → 7 1100 → C 1001 → 9 0100 → 4
=$$(7C94)_{16}$$

1. First, the given number should be converted into binary system.

2. Again the binary digits will be converted into octal numbers right to left.

Example: $$(96AF8)_{16}$$=?
= 9 → 1001 6 → 0110 A → 1010 F → 1111 8 → 1000
=$$(10010110101011111000)_{2}$$
= 010 → 2 010 → 2 110 → 6 101 → 5 011 → 3 111 → 7 000 → 0
=$$(2265370)_{8}$$

Computer codes
In computers, the alphabets, numbers, and special characters are represented in binary code only.

• There are two important codes in computer awareness such as BCD and ASCII.

• BCD stands for Binary Coded Decimal. It represents four digits and is developed by IBM Corporation.

• This method is used to represent binary digits as decimal digits. This system doesn’t have any limit on the size of a number.

• ASCII: American Standard Code for Information Interchange is represented by 7 bits. It explains 128 character codes from 0 to 127.

### Questions

1. After counting 0, 1, 10, 11, the next binary number is

1. 12
2. 100
3. 101
4. 110

2. The digital systems usually operate on …….. system.

1. binary
2. decimal
3. octal

3. The binary system uses powers of ……..for positional values.

1. 2
2. 10
3. 8
4. 16

4. After counting 0, 1, 10, 11, the next binary number is

1. 12
2. 100
3. 101
4. 110

5. The number 10002 is equivalent to decimal number

1. 1000
2. 8
3. 4
4. 16

6. In binary numbers, shifting the binary point one place to the right.

1. multiplies by 2
2. divides by 2
3. decreases by 10
4. increases by 10

7. The binary addition 1 + 1 + 1 gives

1. 111
2. 100
3. 110
4. 11

8. The result of binary subtraction (100 − 011) is

1. −111
2. 111
3. 011
4. 001

9. Convert hexadecimal value 16 to decimal

1. 2210
2. 1610
3. 1010
4. 2010

10. convert decimal 64 to binary

1. 01010010
2. 01000000
3. 00110110
4. 01001000

11. The sum of 1101+10111 equals _______.

1. 110011
2. 100001
3. 110100
4. 100100

12. How many bits are in an ASCII character?

1. 16
2. 7
3. 8
4. 4

13. The sum of two BCD numbers, 0011+ 0011, is_______

1. 0110
2. 0111
3. 0011
4. 1100

14. The binary number 1110 is equals to decimal number ________ .

1. 3
2. 1
3. 7
4. 14

15. Convert the gray code 1011 to binary

1. 1011
2. 1010
3. 0100
4. 1101

16. Digital electronic devices are based on the ______ number system.

1. Decimal
2. Octal
3. Binary

17. The base of the hexadecimal system is _____

1. 8
2. 16
3. 10
4. 2

18. The two digits in the binary system are

1. 1,2
2. H,L
3. T,F
4. 0,1

19. The binary system uses powers of _____ for positional values.

1. 2
2. 10
3. 8
4. 16

20. ______ operations is inverse of addition.

1. Subtraction
2. Multiply
3. Divide
4. All of the above