0% found this document useful (0 votes)
15 views31 pages

2nd Quarter Number Systems and Codes With No Answer 2

The document outlines objectives and outcomes related to number systems, including binary, decimal, and hexadecimal conversions. It explains the methods for converting between these bases, including examples and exercises for practice. Additionally, it covers Binary-Coded-Decimal (BCD) and floating-point conversions, providing techniques for both integer and fractional parts.

Uploaded by

yeppi462
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)
15 views31 pages

2nd Quarter Number Systems and Codes With No Answer 2

The document outlines objectives and outcomes related to number systems, including binary, decimal, and hexadecimal conversions. It explains the methods for converting between these bases, including examples and exercises for practice. Additionally, it covers Binary-Coded-Decimal (BCD) and floating-point conversions, providing techniques for both integer and fractional parts.

Uploaded by

yeppi462
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
You are on page 1/ 31

Objectives :

•Binary, Decimal, Hexadecimal


•Number Conversion
Outcomes
 At the end of this chapter, students should be able to:-
 Differentiate between decimal, binary & hexadecimal
Convert number between bases.
1.0 Types of Number System
1.1 List of Number
Type Base Numbers/Symbols

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

Octal 8 0, 1, 2, 3, 4, 5, 6, 7

Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
2.0 Binary Numbers

 Used to represent the voltage levels of a


digital circuit.
 The binary numbers represent the logic
low as a 0 and the logic high as a 1.
2.1 Binary Numbers Example
2.2 Decimal ➔ Binary Conversion
 A decimal number can be converted to a binary number by
successively dividing the number by 2 as follows:

•Note that the first remainder becomes the most significant bit (MSB). The
last remainder becomes the least significant bit (LSB).
2.3 Binary ➔ Decimal Conversion
 A binary number is converted to a decimal number by summing
together the weights of various positions in the binary number which
contain a 1. For example, 10101112 = 8710.
3.0 Hexadecimal Number
 The hexadecimal number uses base 16. It uses the digits 0 through 9
plus the letters A, B, C, D, E and F.

 The letter A stands for decimal 10, B for 11, C for 12, D for 13, E for
14 and F for 15.
3.1 Hexadecimal Number
3.2 Decimal ➔ Hexadecimal Conversion
 A decimal number can be converted to hex number by successively
dividing the number by 16 as follows:
3.3 Hexadecimal ➔ Decimal Conversion
 To convert a hex number to a decimal number, multiply each hex
value by the weight of the digit and sum the results. For example,
1A716 = 42310.
3.4 Hexadecimal Binary Conversion
 Each hex digit can be represented by a 4-bit binary number as
shown above. Conversion from hex to binary is very straightforward.
Each hex digit is replaced by 4-bit binary number.

 A binary number is converted into an octal number by taking groups


of 4 bits, starting from LSB, and replacing them with a hex digit. For
example, 110101102 = 3268.
4.0 Decimal

 Conversions between decimal and binary can become long and


complicated for large numbers.

 For example, convert 87410 to binary. The answer is 11011010102,


but it takes quite a lot of time and effort to make this conversion. We
call this straight binary coding.
4.1 Binary-Coded-Decimal (BCD)
 The Binary-Coded-Decimal (BCD) code makes conversion much
easier. Each decimal digit, 0 through 9, is represented with a 4-Bit
BCD code as shown below. The BCD code 1010, 1011, 1100, 1101,
1110 and 1111 are not used.
5.2 Decimal ➔ BCD Conversion
 Conversion between BCD and decimal is accomplished by replacing
a 4-bit BCD for each decimal digit. For example, 87410 = 1000 0111
0100BCD.

 BCD is not another number system like binary, octal, decimal and
hexadecimal. It is in fact the decimal system with each digit encoded
in its binary equivalent. A BCD code is not the same as a straight
binary number. For example, the BCD code requires 12 bits, while
the straight binary number requires only 10 bits to represent 87310.
5.3 BCD ➔ Decimal Conversion

 A BCD code is converted into a decimal number by taking groups of


4 bits, starting from LSB, and replacing them with a BCD code. For
example, 1 1001 0111 1000 BCD = 197810
Exercises 1
1. Convert decimal 23410 to
A. binary

2. Convert binary 10010111012 to


A. decimal
B. hexadecimal

3. Convert hexadecimal ABF216 to


A. binary
B. decimal
6.0 Base Conversion for Floating Points with the
Remainder Method

Decimal ➔ Binary

Eg. Convert 23.37510 to base 2.


Technique:
1. Start by converting the integer portion:
6.0 Floating Points Conversion using Remainder Method

Decimal ➔ Binary
2. Then, convert the fraction by multiply it with the based we want to convert:

IF ZERO, THEN STOP


6.0 Base Conversion for Floating Points with the
Remainder Method

Binary ➔ Decimal
Eg. 1010.012 = _________ 10
 Technique:
– Multiply each binary number by 2-n, where -n is the weight of the bit for fraction starting from
left to right. .
– Then, sum the results.

1010.012
= 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20 . 0 x 2-1 + 1 x 2-2
= 10 + 0.25
= 10.25 10
Therefore, 1010.012 = 10.2510
6.0 Base Conversion for Floating Points with the
Remainder Method
Octal – Decimal
Technique:
– Multiply each octal number by 8-n, where -n is the weight of the bit for fraction
starting from left to right. .
– Then, sum the results.

Eg. 46.38 = _________ 10

46.38 = 4 x 81 + 6 x 80 + 3 x 8-1
= 38 + 0.375
= 38.375 10

Therefore, 46.38 = 38.37510


6.0 Base Conversion for Floating Points with the
Remainder Method
Hexadecimal - Decimal
Technique:
– Multiply each hexadecimal number by 16-n, where -n is the weight of the bit for
fraction starting from left to right.
– Then, sum the results.

Eg. A7.0F16 = _________ 10

A7.0F16 = 10 x 161 + 7 x 160 + 0 x 16-1 + 15 x 16-2


= 167 + 0.059
= 167.059 10

Therefore, A7.0F16 = 167.05910


1
Learning Task : Conversion Time!

Solve the items provided below. Convert Binary


numbers into Decimal.

__________ 1. 1101 __________6. 1011


__________ 2. 1000 __________7. 0110
__________ 3. 1110 __________8. 1011
__________ 4. 0101 __________9. 1010
__________ 5. 0011 __________10. 1001
Learning Task 2: Conversion Time!
Solve the items provided below. Convert Decimal
numbers into Binary.

________ 1. 84 ________ 6. 52
________ 2. 25 ________ 7. 38
________ 3. 121 ________ 8. 19
________ 4. 17 ________ 9. 201
________ 5. 66 ________ 10. 103
CONVERSION Convert the following number to
the indicated base/code with
QUIZ 2.1 solution. -
1 pt each 2 pts each 2 pts each
BINARY TO DECIMAL DECIMAL TO BINARY BINARY TO HEXA-DC

WITH SOLUTION WITH SOLUTION


(1 POINT) (1 POINT)
CONVERSION Convert the following number to
the indicated base/code with
QUIZ 2.1 solution.
1 pt each 2 pts each 2 pts each
BINARY TO DECIMAL DECIMAL TO BINARY BINARY TO HEXA-DC

1. 1010111 6. 88 11. 1011001


2. 0101011 7. 92 12. 01101
3. 1010110 8. 105 13. 101101
4. 0101110 9. 128 14. 11100
5. 1011011 10. 204 15. 01010
CONVERSION
QUIZ 2.2
Convert the following number to the
indicated base/code with solution.

1. 101010112 = ____10 = ____16


2. 52B16 = ____10 = ____2
3. 32010 = ____2 = ____16
4. 2FB16 = ____10 = ____2
5. 10101010 = ____16 = ____2

You might also like