0% found this document useful (0 votes)
24 views

Chapter 1 Number Systems v6 - Copy 2

The document discusses different number systems including binary, decimal, hexadecimal and conversions between them. It also covers encoding schemes such as binary-coded decimal (BCD) used to represent decimal numbers in binary. Gray code is introduced which minimizes bit changes between adjacent numbers to reduce errors during encoding/decoding. Finally, the ASCII character encoding standard is mentioned.

Uploaded by

marlar24
Copyright
© © All Rights Reserved
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Chapter 1 Number Systems v6 - Copy 2

The document discusses different number systems including binary, decimal, hexadecimal and conversions between them. It also covers encoding schemes such as binary-coded decimal (BCD) used to represent decimal numbers in binary. Gray code is introduced which minimizes bit changes between adjacent numbers to reduce errors during encoding/decoding. Finally, the ASCII character encoding standard is mentioned.

Uploaded by

marlar24
Copyright
© © All Rights Reserved
Available Formats
Download as KEY, PDF, TXT or read online on Scribd
You are on page 1/ 20

Official (Closed) - Non Sensitive

Chapter 1 Number Systems


Electrical & Electronics Technology
(29EAET)
Official (Closed) - Non Sensitive

Instructional Objectives
Perform decimal to binary or hexadecimal conversion and vice versa.
Express decimal numbers using the Binary-Code- Decimal (BCD) code.
Explain the need for ASCII Code.
Understand the need for Gray code
YouTube video
a) This video provides a basic introduction into number systems such decimal, binary, octal and hexadecimal
numbers:
b) https://www.youtube.com/watch?v=FFDMzbrEXaE&t=415s
c) This video tutorial explains how to convert hexadecimal to binary numbers.
d) https://www.youtube.com/watch?v=D_YC6DSPpQE
Official (Closed) - Non Sensitive

1.1 Number Systems


Most common number systems in use are Decimal,
Binary and Hexadecimal.

012345 0123456789
0
6789 ABCDEF
1

1 2 1
0 6
10 2 16
K K K
Official (Closed) - Non Sensitive

1.1.1 Binary Numbers


Binary system is used in digital systems, such as computers.
It uses two symbols “0” & “1” called bits,

Least significant bit (LSB) is the bit position in a binary number giving the least
value.
Most significant bit (MSB) is the bit position in a binary number having the
greatest value.
Easy to design electronic circuits to operate with two voltage levels, representing
the 2 symbols in a binary system
Official (Closed) - Non Sensitive

1.1.1 Binary Numbers


For an n-bit binary number,
the total number of decimal equivalents or combinations = 2 n
The largest decimal number = (2n - 1)
Ranges from 0 to (2n - 1)

Number of bits, n=3


Total number of combinations = 23 = 8 (000,001,010,…111)
The largest decimal number in the range
= (2n - 1) = 23 -1 =7
The number ranges from: 010 to 710
Official (Closed) - Non Sensitive

1.1.1 Hexadecimal Numbers


In this system there are 16 symbols or possible digit values from 0 to 9, followed by six alphabetic
characters -- A, B, C, D, E and F.
Official (Closed) - Non Sensitive

1.2 Conversion Between Number Systems


1.2.1 Binary to Decimal Conversion
Example
Convert the following Binary numbers to their Decimal equivalents using
sum of position weights method.
(a) 110101012

= 1 x 27 + 1 x 26 + 1 x 24 + 1 x 22 + 1 x 20 (the weight is highlighted)


= 128 + 64 + 16 + 4 + 1 (positional value)
= 21310
Each binary digit has its value expressed in powers of 2, depending on its position
Official (Closed) - Non Sensitive

1.2.2 Decimal to Binary Conversion


Convert the following Decimal numbers to their Binary
equivalents using repeated division by 2 method.
Example – convert 5710 to binary

Many students missed this digit in their answer


Official (Closed) - Non Sensitive

1.2.3 Hexadecimal to Decimal Conversion


Convert the following Hex numbers to their Decimal equivalents
using sum of position weights method.
Example – convert 2C716 to decimal

= 2 x 162 + 12 x 161 + 7 x 160


= 2 x 256 + 12 x 16 + 7 x 1 (positional value)
= 71110

Each HEX digit has its value expressed in powers of 16, depending on its position
Official (Closed) - Non Sensitive

1.2.4 Decimal to Hexadecimal Conversion


Example
Convert the following Decimal numbers to their Hexadecimal
equivalents using repeated division by 16 method.
(a) 29910
Many students made a mistake here
Official (Closed) - Non Sensitive

1.3 Encoding and Codes


Encoding is to represent numerical quantities, alphanumeric characters or
words by a group of symbols.
The group of symbols is called a code.

Most commonly seen codes:

Straight binary code


Binary coded decimal code (BCD code)
Gray code
Alphanumeric code
Official (Closed) - Non Sensitive

1.3.1 Binary Coded Decimal (BCD)


BCD is a 4-bit binary number used to represent decimal
digits.
Only TEN 4-bit binary codes are used to represent decimal
numbers ranging from 0 to 9.

Invalid code
Official (Closed) - Non Sensitive

ExampleConvert the following decimal numbers to their


equivalent BCD codes.
(a) 3610

(b) 32410
= 0011 0110BCD
BCD code contains
groups of 4-bit binary
= 0011 0010 0100BCD number
Official (Closed) - Non Sensitive

ExampleConvert the following BCDs to their decimal


equivalents respectively.(a) 001010010001BCD = 0010 1001
0001BCD
= 2 9 110
(b) 101000110110BCD = 1010 0011 0110BCD
= not possible as
1010 is an illegal code

Steps:
start from the right and group the bits into 4 bits,
then replace every group of 4 bits with the equivalent decimal digit.
Official (Closed) - Non Sensitive

Example Convert the following BCDs to their HEX equivalents


(a) 001010010001BCD = 0010 1001 0001BCD
= 2 9 110
16|_291
16|_ 18 ---- r 3
16|_ 1 ---- r 2
0 ---- r 1
001010010001BCD = 12316

2-step process
Convert the BCDs to their decimal equivalents, then make a conversion to HEX
Official (Closed) - Non Sensitive

Example Convert the following BCDs to their HEX equivalents


(b)001100101000BCD = 0011 0010 1000BCD
= 32810
16|_328
16|_ 20 ---- r 8
16|_ 1 ---- r 4
0 ---- r 1
0011 0010 1000BCD = 14816

Steps
start from the right and group the bits into 4 bits and convert the BCDs to their decimal equivalents, then
convert the decimal number into Hexadecimal, using repeated division by 16 method
Official (Closed) - Non Sensitive

Summary
Official (Closed) - Non Sensitive

1.3.2 GRAY code (reference)


This is also known as unweighted code. This is used to
represent decimal value but the bit position is unweighted
It is also known as minimum-change code as the adjacent
numbers have a single digit differing by 1.
3-bit Gray Code 3-bit Gray Code

Outer track digit is highlighted in blue


Official (Closed) - Non Sensitive

1.3.2 Gray Code (reference)


If using Binary Code in encoder tracks, there are many positions where several
tracks change state simultaneously. This may easily result in an error due to
misalignment.
However, Gray code reduces the bit change to only one data bit per measuring step at a time.
So then, if an error occurs, the resulting error will be only one bit.

4-bit Gray Code


When code 3 changes to code 4, the bit change is illustrated in BLUE

The far-right digit is the Outer Track digit


Official (Closed) - Non Sensitive
1.3.2 Other Types of Codes (reference)
American standard code for Information Interchange
(ASCII)
A 7-bit code that represents numbers, alphabets and control
information.
For example, 100 0001 represents character “A”
0000 0001

000
001
010
011
100
101
110
111

You might also like