Introduction To: Digital Electronics
Introduction To: Digital Electronics
INTRODUCTION TO
DIGITAL ELECTRONICS
NUMBER SYSTEMS:
DECIMAL NUMBERS
BINARY NUMBER SYSTEM
• The binary number system is another way to
represent quantities.
• It has only two digits.
• The decimal system with its ten digits is a base ten
system. The binary system with its two digits is a
base two system.
• The Two binary digits (bits) are 1 and 0.
• The position of 1 or 0 in a binary number indicates
its weight or value within the number, just as the
position of a decimal digit determines the value of
that digit in a number.
COUNTING IN BINARY
• First look how you count in the decimal system:
you add another digit position when you have
run out of digits or exhausted all digit
combinations:
• Counting from 0 to 9 you run out of digits, so
you start another digit position and continue
counting 10 to 99. At this point you have
exhausted all two-digit combinations, so you add
another digit position to count from 100 to 999.
COUNTING IN BINARY
• Begin counting: 0, 1. At this point you have used
both digits so you need another digit position.
• continuing to 10, 11. You have now exhausted
all combinations of two digits, so a third
position is required.
• With three digit positions you can continue to
count: 100, 101, 110, and 111. Now you need a
fourth digit position to continue and so on.
• With n bits you can count up to
• The left most bit is the MSB (Most significant bit) has the
highest weight (depending on the size of the binary
number).
• Fraction numbers can also be represented in binary
by placing bits to the right of the binary point (just
as fractional decimal digits are placed to the right of
the decimal point)
• The left most bit is the MSB in a binary fractional
number and has a weight of
• Example:
Hexadecimal number system
• Hexadecimal number system has sixteen
characters.
• It is used primarily as a compact way of displaying
or writing binary numbers because it is very easy
to convert between binary and hexadecimal.
• It has a base of sixteen; that is, it is composed of
16 numeric and alphabetic characters.
How to count in hexadecimal
• To continue counting in hexadecimal once you get to F you
continue as follows:
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 2A, 2B, 2C, 2D, 2F, 30, 31, …
• With two hexadecimal digits, you can count up to FF16 which is
255. To count beyond this three hexadecimal digits are
needed. Example 10016 is decimal 256, 10216 is decimal 258
etc,
• The maximum 3-digit hexadecimal number is FFF16 which is
decimal 4095. The maximum 4 digit hexadecimal number is
FFFF16 which is 65,535.
Binary to Hexadecimal Conversion
• If there are not three bits available for the left most
bits, add one or two zeros.
examples
BINARY CODED DECIMAL
• Binary coded decimal (BCD) is a way to express each
of the decimal digits with a binary code.
• Because we like to read and write in decimal, the
BCD code provides an excellent interface to binary
systems.
• Examples of such interfaces are keypad inputs and
digital read outs.
• The 8421 code is a type of BCD code which is the
most popular/predominant. (when BCD code is
referred it means 8421 code unless otherwise
stated)
• The designation 8421 indicates the binary weights
of the four bits :
Invalid codes
• With four bits, sixteen numbers (0000 through
1111) can be represented but that in the 8421 code
only ten of these are used.