0% found this document useful (0 votes)
21 views6 pages

Number System Conversion Guide

lab

Uploaded by

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

Number System Conversion Guide

lab

Uploaded by

FarhanAshraf
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ITNE2003

Install, Configure, Operate and Troubleshoot


Medium-Networks

Lab Tutorial - 2 of Lesson - 2

June 2018
Counting System Tutorial
ITNE2003 Lab Tutorial 2

Base 10 System (Decimal)


To get a good understanding of other number systems, let’s begin with a familiar topic - the
base 10 system. In order to represent the base 10 system, we need 10 different symbols. The
symbols we use of course are the digits 0 through 9. If we were to write a value using base 10,
it would look like the following:

301810

The subscript 10 has been placed on the end of the value so that there is no doubt that we are
working with a base 10 value.

Breaking the value apart one digit at a time, the 8 is in the 1s position and is equal to 8 x 100, or
simply 8 x 1 (anything to the 0th power is 1); the 1 is in the 10s position and is equal to 1 x 101,
or 10; the 0 is in the 100s position and is equal to 0 x 102, or 0 x 100; and the 3 is in the 1000s
position and is equal to 3 x 103, or 3 x 1000. Note that starting on the right, the powers start at
0 and increment by 1 for every place we move to the left.

Base 2 System (Binary)


The binary system or base 2 system uses only 2 symbols - 0 and 1. If we were to write a binary
number, it might look like the following:

10010101001012

Starting again with the right-most digit, we have a 1 in the 1s position, or 1 x 20 which is equal
to 1 x 1; the next digit 0 is in the 2s position and is 0 x 21; the next digit 1 is in the 4s position
and is equal to 1 x 22 or 1 x 4; the next digit 0 is in the 8s position and is equal to 0 x 23, or 0 x 8,
and so on. Notice how the positions start with 1 on the right-most bit and proceed to double
for each next position - 1, 2, 4, 8, 16, 32, 64, 128, and so on. This corresponds to 20, 21, 22, 23,
24, 25, 26, and 27.

Thus, the binary number 100102

is equal to (starting from the left) 16 + 0 + 0 + 2 + 0, or 18 in decimal.

The binary number 10111012

is equal to 64 + 0 + 16 + 8 + 4 + 0 + 1, or 93 in decimal.

Base 16 Number System (Hexadecimal)


The binary number system can generate some pretty long strings of 1s and 0s for relatively
small equivalent decimal values. For example, decimal 16492 is equal to binary

Copyright © 2015-2018 VIT, All Rights Reserved. 2


ITNE2003 Lab Tutorial 2

100000001101100. Many people and computer systems often like to work with a notation that
is more compact but still closely resembles binary. One choice is the base 16 number system,
or hexadecimal. Following the same thread of logic, the base 16 number system needs 16
symbols. The first ten symbols can be the common digits 0 through 9, but what to use for the
remaining six symbols? We will use the symbols A, B, C, D, E, and F. Thus we use the symbols 0
- F, which are equivalent to the following decimal and binary values:

Hexadecimal Decimal Binary

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

A 10 1010

B 11 1011

C 12 1100

D 13 1101

E 14 1110

F 15 1111

If we were to write a hexadecimal number as the following:

Copyright © 2015-2018 VIT, All Rights Reserved. 3


ITNE2003 Lab Tutorial 2

C 2 A B16

we would have the following equivalent decimal value: C x 163, or 1210 x 4096; 2 x 162, or 2 x
256; A x 161, or 1010 x 16; and B x 160, or 1110 x 1. The resulting decimal value would be 49835.

The neat thing about hexadecimal and binary is how easy it is to translate one form into the
other. For example, if we have the hexadecimal value C2AB from above, we can easily convert
it to binary by simply replacing each hex digit with the corresponding 4-bit binary equivalent.

C = 11002

2 = 00102

A = 10102

B = 10112

The resulting binary value would be 1100 0010 1010 10112.

Conversely, to convert a binary value to hexadecimal, simply group the binary number in groups
of 4 digits (starting from the right) and convert each 4-digit group into its equivalent
hexadecimal value.

For example, the binary value: 111 1000 1010 1001 0011 0101 11002 equals 78A935C16

Copyright © 2015-2018 VIT, All Rights Reserved. 4


ITNE2003 Lab Tutorial 2

Conversion from One Number System to Another


We have already seen how to do some number conversions. Binary to hexadecimal and
hexadecimal to binary are straightforward. We have also seen how to convert binary to
decimal. Start at the right side of the binary number and count in powers of 2. The right-most
binary digit is in the 1s position, the next binary digit is in the 2s position, then the 4s position,
the 8s position, and so on.

Converting from decimal to binary is also straight-forward. One simple paper and pencil
method1 is to take the decimal number and repeatedly divide it by 2, keeping track of the
integer remainder. For example, lets convert the decimal value 57 to binary using this method.

____

2 ) 57

28 with a remainder of 1 (now divide 28 by 2)

14 with a remainder of 0

7 with a remainder of 0

3 with a remainder of 1

1 with a remainder of 1

0 with a remainder of 1.

Now take all the remainders starting with the last one and write your binary number:

1 1 1 0 0 12

Is this the correct binary value? Check it. The left-most bit equals 32, the next bit equals 16,
the next bit equals 8, and the right-most bit equals 1. 32 + 16 + 8 + 1 = 57.

1
There are of course calculators that can do all these conversions. But if the calculator is not
handy, you should be able to perform simple conversions either in your head or on paper and
pencil.

Copyright © 2015-2018 VIT, All Rights Reserved. 5


ITNE2003 Lab Tutorial 2

You can also convert decimal to hexadecimal in a similar fashion (repeatedly divide by 16 and
keep track of the integer remainders) but it might be easier to convert the decimal number to
binary first, then simply convert the binary number to hexadecimal.

Sample Problems
1. Write the binary equivalent of decimal 149.

2. Write the binary equivalent of decimal 314.

3. Write the hexadecimal equivalent of binary 10100101001010010101.

4. Write the hexadecimal equivalent of binary 001001010111110101101001110.

5. Write the decimal equivalent of binary 100101001010101111.

6. Write the decimal equivalent of binary 00110011101010110.

7. Write the binary equivalent of hexadecimal 3C9AA53E.

8. Write the binary equivalent of hexadecimal 1FFE.

Copyright © 2015-2018 VIT, All Rights Reserved. 6

Common questions

Powered by AI

Dividing a decimal number by 16 repeatedly and noting the integer remainders helps convert it to hexadecimal by sequentially determining each hex digit starting from the least significant. Each division's remainder directly corresponds to a hexadecimal digit. An alternate and sometimes simpler method is first converting the decimal to binary, then grouping the binary into 4-bit segments and directly translating these into hexadecimal digits . This binary approach reduces errors and simplifies the logical mapping between binary and hexadecimal, particularly for large numbers .

Understanding the base 10 system, which uses ten distinct symbols (0 through 9), forms the foundation for comprehending other numerical systems like binary and hexadecimal. In base 10, numbers are structured using powers of 10, similar to how binary uses powers of 2 and hexadecimal uses powers of 16 . Grasping this positional value concept helps in recognizing patterns in other systems, allowing for simpler conversions. For example, understanding powers and positions aids in the conversion of numbers from one system to another, such as converting a decimal number like 57 to binary by recognizing that it involves powers of 2 .

In the binary number system, each digit's position represents a power of 2. This positional value is critical when converting from binary to decimal because each binary '1' contributes a value equal to 2 raised to the power of its position index. As such, calculating a binary number's decimal equivalent involves summing these products. Understanding these powers is essential for accurate conversion, allowing the determination of each bit's contribution to the number’s aggregate decimal value . This systematic approach ensures precision in interpreting binary numbers as standard decimal values .

The subscript notation indicates the base system being used for a given number. This is crucial because the same digits can represent different values in different bases. For example, the number 301810 with a subscript of 10 makes clear that it's a base 10 value, and each digit's position corresponds to powers of 10 . This aids in clarity and prevents misinterpretation, especially when dealing with multiple number systems such as binary (base 2) or hexadecimal (base 16), where the same numeric symbols might represent completely different values .

The conversion from binary to hexadecimal is straightforward due to the direct mapping between each hexadecimal digit and four binary digits. This process involves grouping the binary number into sets of four bits starting from the right. Each group of four can then be directly translated into its hexadecimal equivalent. For example, the binary number 1100001010101011 groups into 1100 0010 1010 1011, which translates to C2AB in hexadecimal . This one-to-one correspondence simplifies the conversion process significantly .

Hexadecimal numbers are preferred over binary in computational contexts because they provide a more compact representation of long binary strings. Each hexadecimal digit corresponds to exactly four binary digits, which simplifies the notation and reduces the length of numbers significantly. This compactness makes it easier for humans to read and write binary-based data without losing the underlying structure or values, maintaining close correspondence with binary signals processed within computers .

The manual method to convert a decimal number to binary involves repeatedly dividing the number by 2 and keeping track of the remainders. Starting with the given decimal number, you divide it by 2, record the integer remainder, then continue dividing the quotient by 2, repeating this process until the quotient is zero. The binary number is then formed by reading the remainders in reverse order. For instance, converting 57 to binary using this method results in remainders that construct the binary number 111001 .

Hexadecimal numbers are widely used in computer systems for memory addressing, defining colors in web design, and representing machine code. Their compact nature allows for a more human-readable format of binary data, which is essential for coding, debugging, and understanding low-level operations. Memory addresses, which can be very long in binary due to the large number of possible combinations, become shorter and more manageable when expressed in hexadecimal. Similarly, colors in HTML are defined using hexadecimal codes for each of the RGB components. Their application in representing compressed data further illustrates their efficiency .

Converting between number systems is applied in various technological and computing tasks such as network addressing, data storage, and arithmetic operations within processors. IP addresses are often written in decimal or hexadecimal, requiring frequent conversions for configuration and troubleshooting. Similarly, programmers convert between hexadecimal and binary when reading assembly language or interpreting machine code. Understanding these conversions is crucial for software development and debugging, where precision in bit-level operations directly impacts functionality and performance . Additionally, optimizing memory usage often involves calculations across these number systems .

Converting large binary numbers to decimal can be challenging due to the need to manage substantial powers of 2, which can quickly become large and cumbersome. This conversion requires calculating and summing the products of each binary digit's value with its corresponding power of 2, which can be error-prone without careful calculation. Errors can be mitigated by employing systematic approaches, such as creating tables to ensure accurate calculation of powers and corresponding binary values, and using calculators for verification. Additionally, breaking the binary number into smaller, manageable portions can simplify the conversion process .

You might also like