Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
64 views8 pages

Number System 3rd Assignment

The document explains various number systems used in computer architecture, including binary, octal, decimal, and hexadecimal systems, along with their bases and digit representations. It provides detailed methods for converting between these systems, including examples of converting decimal numbers to binary, octal, and hexadecimal, as well as vice versa. Additionally, it includes specific conversion examples for binary, octal, decimal, and hexadecimal numbers.

Uploaded by

ranahaqnawaz634
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views8 pages

Number System 3rd Assignment

The document explains various number systems used in computer architecture, including binary, octal, decimal, and hexadecimal systems, along with their bases and digit representations. It provides detailed methods for converting between these systems, including examples of converting decimal numbers to binary, octal, and hexadecimal, as well as vice versa. Additionally, it includes specific conversion examples for binary, octal, decimal, and hexadecimal numbers.

Uploaded by

ranahaqnawaz634
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

NUMBER SYSTEM

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.

Computer architecture supports following number systems.

 Binary number system

 Octal number system

 Decimal number system

 Hexadecimal (hex) number system

1. 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.

2. OCTAL NUMBER SYSTEM

Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents
with 0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8,
because it has only 8 digits.

3. DECIMAL NUMBER SYSTEM

Decimal number system has only ten (10) digits from 0 to 9. Every number (value)
represents with 0,1,2,3,4,5,6, 7,8 and 9 in this number system. The base of decimal number
system is 10, because it has only 10 digits.

4. HEXADECIMAL NUMBER SYSTEM

A Hexadecimal number system has sixteen (16) alphanumeric values from 0 to 9 and A to F.
Every number (value) represents with 0,1,2,3,4,5,6, 7,8,9,A,B,C,D,E and F in this number
system. The base of hexadecimal number system is 16, because it has 16 alphanumeric
values. Here A is 10, B is 11, C is 12, D is 14, E is 15 and F is 16.

Number system Base(Radix) Used digits Example

Binary 2 0,1 (11110000)2

Octal 8 0,1,2,3,4,5,6,7 (360)8

Decimal 10 0,1,2,3,4,5,6,7,8,9 (240)10


0,1,2,3,4,5,6,7,8,9,
Hexadecimal 16 A,B,C,D,E,F (F0)16

CONVERSIONS

1
DECIMAL TO OTHER
5. 1. DECIMAL TO BINARY

Decimal Number System to Other Base

To convert Number system from Decimal Number System to Any Other Base is quite
easy; you have to follow just two steps:
A) Divide the Number (Decimal Number) by the base of target base system (in which
you want to convert the number: Binary (2), octal (8) and Hexadecimal (16)).
B) Write the remainder from step 1 as a Least Signification Bit (LSB) to Step last as a
Most Significant Bit (MSB).
Decimal to Binary Conversion Result
Decimal Number is : (12345)10

Binary Number is
(11000000111001)2

6. 2. DECIMAL TO OCTAL
Decimal to Octal Conversion Result
Decimal Number is : (12345)10

Octal Number is
(30071)8

7. 3. DECIMAL TO HEXADECIMAL

Decimal to Hexadecimal Conversion Result

2
Example 1
Decimal Number is : (725)10 Hexadecimal Number is
(2D5)16 Convert
10, 11, 12, 13, 14, 15
to its equivalent...
A, B, C, D, E, F

BINARY TO OTHER
A) Multiply the digit with 2(with place value exponent). Eventually add all the multiplication
becomes the Decimal number.
8. 1. BINARY TO DECIMAL

9. 2. BINARY TO OCTAL

An easy way to convert from binary to octal is to group binary digits into sets of three,
starting with the least significant (rightmost) digits.
Binary: 11100101 = 11 100 101
011 100 101 Pad the most significant digits with zeros if
necessary to complete a group of three.
Then, look up each group in a table:
Binary: 000 001 010 011 100 101 110 111
Octal: 0 1 2 3 4 5 6 7

10. 3. BINARY TO HEXADECIMAL

An equally easy way to convert from binary to hexadecimal is to group binary digits into sets
of four, starting with the least significant (rightmost) digits.

Binary: 11100101 = 1110 0101

Binary = 1110 0101

Hexadecimal = E 5 = E5 hex

3
OCTAL TO OTHER

11. 1. OCTAL TO BINARY

Converting from octal to binary is as easy as converting from binary to octal. Simply look up
each octal digit to obtain the equivalent group of three binary digits.
Octal: 0 1 2 3 4 5 6 7
Binary: 000 001 010 011 100 101 110 111

12. 2. OCTAL TO HEXADECIMAL

When converting from octal to hexadecimal, it is often easier to first convert the octal number
into binary and then from binary into hexadecimal. For example, to convert 345 octal into
hex: (from the previous example)
Octal = 3 4 5

Binary = 011 100 101 = 011100101 binary

Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits):
Binary 011100101 = 1110 0101

Then, look up the groups in a table to convert to hexadecimal digits.


Binary: 0000 0001 0010 0011 0100 0101 0110 0111

Hexadecimal: 0 1 2 3 4 5 6 7

Therefore, through a two-step conversion process, octal 345 equals binary 011100101 equals
hexadecimal E5.

13. 3. OCTAL TO DECIMAL

The conversion can also be performed in the conventional mathematical way, by showing
each digit place as an increasing power of 8.

345 octal = (3 * 82) + (4 * 81) + (5 * 80) = (3 * 64) + (4 * 8) + (5 * 1) = 229 decimal

OR

Converting octal to decimal can be done with repeated division.

1. Start the decimal result at 0.


2. Remove the most significant octal digit (leftmost) and add it to the result.
3. If all octal digits have been removed, you’re done. Stop.
4. Otherwise, multiply the result by 8.
5. Go to step 2.

Octal Digits Operation Decimal Result Operation Decimal Result


345 +3 3 ×8 24

4
45 +4 28 ×8 224
5 +5 229 done.

 (345)8 =(229)10

HEXADECIMAL TO OTHER
1. HEXADECIMAL TO BINARY

Converting from hexadecimal to binary is as easy as converting from binary to hexadecimal.


Simply look up each hexadecimal digit to obtain the equivalent group of four binary digits.
Hexadecimal: 0 1 2 3 4 5 6 7
Binary: 0000 0001 0010 0011 0100 0101 0110 0111

Question #2 Exemplify few Conversions: (20 Marks)


1. Convert each of the following binary numbers to octal, decimal, and hexadecimal
formats. (111011101)2
Binary Number = (111011101)₂

A) Binary to Octal:
 Group the binary digits into 3-bits from right to left:
111 011 101
 Convert each group to octal:
o 111 → 7
o 011 → 3
o 101 → 5
Final Result:
(735)₈
2) Convert each of the following octal numbers to binary, decimal, and hexadecimal formats.
(3754)8
2.1) Octal to Binary
Each octal digit is converted into a 3-bit binary number:
Octal Digit Binary Equivalent
3 011
7 111
5 101
4 100
(3754)₈ = 011111101100₂
Final Result:
(11111101100)₂

2.2✅ B) Octal to Decimal


Using the formula:
(abc...)₈ = a×8ⁿ + b×8ⁿ⁻¹ + ... + last_digit×8⁰
For 3754:
(3×83)+(7×82)+(5×81)+(4×80)=(3×512)+(7×64)+(5×8)+(4×1)=1536+448+40+4=2028(3×8^
3) + (7×8^2) + (5×8^1) + (4×8^0) \\ = (3×512) + (7×64) + (5×8) + (4×1) \\ = 1536 + 448 + 40

5
+4=
2028(3×83)+(7×82)+(5×81)+(4×80)=(3×512)+(7×64)+(5×8)+(4×1)=1536+448+40+4=2028
Final Answer:
(2028)₁₀ ✅

2.3✅ C) Octal to Hexadecimal


Step 1: Convert Octal → Binary
(Already done):
(3754)₈ = 11111101100₂
Step 2: Group into 4 bits (from right to left):
Pad left with zeros if needed:
Binary = 0001 1111 0110 1100
Step 3: Convert each group to hexadecimal:
Binary Group Hex Value
0001 1
1111 F
0110 6
1100 C
Final Answer:
(1F6C)₁₆ ✅
3)Convert each of the following decimal numbers to binary, octal, and hexadecimal
formats. (3479)10

3.1 ) Decimal to Binary

Method: Divide the number by 2 repeatedly and record the remainders.

Division Quotient Remainder


3479 ÷ 2 1739 1
1739 ÷ 2 869 1
869 ÷ 2 434 1
434 ÷ 2 217 0
217 ÷ 2 108 1
108 ÷ 2 54 0
54 ÷ 2 27 0
27 ÷ 2 13 1
13 ÷ 2 6 1
6÷2 3 0
3÷2 1 1
1÷2 0 1

📘 Binary = 110110011111
Final Answer:
(110110011111)₂ ✅

3.2 ✅ B) Decimal to Octal

6
Method: Divide the number by 8 repeatedly and record the remainders.

Division Quotient Remainder


3479 ÷ 8 434 7
434 ÷ 8 54 2
54 ÷ 8 6 6
6÷8 0 6

📘 Octal = 6627
Final Answer:
(6627)₈ ✅

3.3 ✅ C) Decimal to Hexadecimal

Method: Divide the number by 16 repeatedly and record the remainders.

Division Quotient Remainder


3479 ÷ 16 217 7
217 ÷ 16 13 9
13 ÷ 16 0 13 (D)

Now, write the remainders from bottom to top, using A–F for 10–15:

📘 Hexadecimal = D97
Final Answer:
(D97)₁₆ ✅

4 ) Convert each of the following hexadecimal numbers to binary, octal, and decimal
formats. (4FB2)16

4.1) Hexadecimal to Binary

Method: Convert each hex digit to its 4-bit binary equivalent using a lookup table.

Hex Digit Binary Equivalent


4 0100
F 1111
B 1011
2 0010

Now combine the binary values:

📘 Binary = 0100 1111 1011 0010


Final Answer:
(0100111110110010)₂ ✅

4.2) ✅ B) Hexadecimal to Octal

7
Method:

1. First convert Hex to Binary → Already done: 0100111110110010


2. Group the binary digits into 3 bits from right to left (pad leading 0s if needed):

Binary: 000 100 111 110 110 010

Binary Group Octal Digit


000 0
100 4
111 7
110 6
110 6
010 2

So, combining these:


📘 Octal = 047662
Final Answer:
(47662)₈ ✅

4.3) ✅ C) Hexadecimal to Decimal


Method: Multiply each digit by 16ⁿ starting from right (n = 0).

(4FB2)₁₆ =
= (4 × 16³) + (F × 16²) + (B × 16¹) + (2 × 16⁰)
= (4 × 4096) + (15 × 256) + (11 × 16) + (2 × 1)
= 16384 + 3840 + 176 + 2
= 20402

📘 Final Answer:
(20402)₁₀ ✅

You might also like