2. Number Systems
What is a number system?
A system for representing numbers
Each number system has a base, which is the
number of digits used to represent numbers
Types of number systems:
Decimal
Binary
Octal
Hexadecimal
3. Decimal number system:
Base 10
Uses the digits 0-9
The most common number system used
in the world
Binary number system:
Base 2
Uses the digits 0 and 1
Used in computers and digital electronics
Octal number system:
Base 8
Uses the digits 0-7
A convenient way to represent binary
numbers
Hexadecimal number system:
Base 16
Uses the digits 0-9 and A-F
A convenient way to represent binary
numbers in a shorter form
4. Converting between number
systems:
There are a number of ways to convert
between number systems
The most common method is to use the
place value table
Place value table:
A table that shows the value of each digit in
a number system
The place value table can be used to convert
a number from one system to another
5. Gray codes
• Gray codes are named
after Frank Gray, who
invented them in 1953.
• Gray codes are also
known as reflected
binary codes
Decimal Number Binary Number Gray Code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
7. Gray codes have many applications in
digital circuits and systems.
Encoders and decoders: Gray codes are often used in encoders and decoders, which are devices that
convert between analog and digital signals.
Analog-to-digital converters (ADCs): ADCs use Gray codes to reduce the effects of noise on the
conversion process.
Digital logic: Gray codes are often used in digital logic circuits, because they can simplify the design of
circuits that count or compare numbers.
Position sensors: Gray codes are often used in position sensors, such as shaft encoders and disk drive
heads.
Karnaugh maps: Gray codes are often used in Karnaugh maps, which are a graphical technique used
for simplifying Boolean expressions.
8. Excess-3
Excess-3 code is a non-weighted and self-complementary binary-coded
decimal (BCD) code and numeral system.
In excess-3 code, numbers are represented as decimal digits, and each
digit is represented by four bits as the digit value plus 3 (the "excess"
amount):
For example, the excess-3 code for the decimal number 5 is 1000, which is
3 + 5 = 8 in binary.
9. Excess-3 code is often used in digital
circuits and systems
Arithmetic operations: Excess-3 code is often used in arithmetic operations in
digital circuits. This is because it is self-complementary and non-weighted, which
makes it easy to implement arithmetic operations.
Error detection: Excess-3 code is often used in error detection in digital circuits.
This is because it has a good error detection capability.
Interfacing with electromechanical devices: Excess-3 code is often used to
interface with electromechanical devices, such as stepper motors and rotary
encoders. This is because it is less susceptible to noise than other BCD codes.
10. ASCII
• ASCII stands for American Standard Code for
Information Interchange.
• It is a character encoding standard for electronic
communication.
• ASCII codes represent text in computers,
telecommunications equipment, and other devices.
• ASCII uses a 7-bit code to represent characters.
• The first 32 codes are control codes, which are used
for things like carriage return, line feed, and bell
• The remaining 128 codes represent printable
characters, including the digits 0-9, the letters A-Z,
and punctuation marks.
11. Parity –ODD, EVEN
Parity is a simple form of error
detecting code. It is used to
check whether the bits in a
binary number have been
transmitted correctly.
There are two types of parity:
even parity and odd parity.
In even parity, the number of 1
bits in the binary number must
be even.
In odd parity, the number of 1
bits in the binary number must
be odd.
12. To check the parity of a
binary number, you can
use the following steps:
1.Count the number of 1 bits in
the binary number.
2.If the number of 1 bits is even,
then the parity is even.
3.If the number of 1 bits is odd,
then the parity is odd.
13. Binary Arithmatics
Single Bit
Addition with
Carry
Multiple Bit
Addition
Single Bit
Subtraction
with Borrow
Multiple Bit
Subtraction
Multiplication BCD Addition
17. Multiple Bit Binary Subtraction
• Extending this to two multiple bit examples:
Borrows 0 0
Minuend 10110 10110
Subtrahend - 10010 - 10011
Difference
• Notes: The 0 is a Borrow-In to the least significant bit. If the
Subtrahend > the Minuend, interchange and append a – to the
result.
19. BCD Addition
Example - 1
21CSS201T-COA 19
Rule: If there is an illegal code or carry is generated as a result
of addition, then add 0110 to particular that 4 bits of
result.
23. BCD Subtraction
Example - 1
21CSS201T-COA 23
Rule: If one 4-bit group needs to take borrow from neighbor, then
subtract 0110 from the group which is receiving borrow.
24. Logic Gates
• All digital computers for the past 50
years have been constructed using
the same type of components.
• These components are called logic
gates.
• Logic gates have been implemented
in many different ways.
• Currently, logic gates are most
commonly implemented using
electronic VLSI transistor logic.
24
25. Logic Gates
All basic logic gates have the ability to accept either one or two input signals (depending upon the type of gate) and generate one output signal.
25
27. Basic Logic Gates-
• Basic Logic Gates are the fundamental logic gates
using which universal logic gates and other logic
gates are constructed.
They have the following properties-
• Basic logic gates are associative in nature.
• Basic logic gates are commutative in nature.
There are following three basic logic gates-
1. AND Gate
2. OR Gate
3. NOT Gate
27
28. AND gate
• The output of AND gate is high (‘1’) if all of its inputs
are high (‘1’).
• The output of AND gate is low (‘0’) if any one of its
inputs is low (‘0’).
29. OR Gate
• The output of OR gate is high (‘1’) if any one of its
inputs is high (‘1’).
• The output of OR gate is low (‘0’) if all of its inputs are
low (‘0’).
30. NOT Gate
• The output of NOT gate is high (‘1’) if its input is low (‘0’).
• The output of NOT gate is low (‘0’) if its input is high (‘1’).
• From here-
• It is clear that NOT gate simply inverts the given input.
• Since NOT gate simply inverts the given input, therefore it is also
known as Inverter Gate.
31. Universal Logic Gates
• Universal logic gates are the logic gates that are
capable of implementing any Boolean function
without requiring any other type of gate.
• They are called as “Universal Gates” because-
• They can realize all the binary operations.
• All the basic logic gates can be derived from
them.
• They have the following properties-
• Universal gates are not associative in nature.
• Universal gates are commutative in nature.
32. NOR Gate
• A NOR Gate is constructed by connecting a NOT Gate at
the output terminal of the OR Gate.
• The output of OR gate is high (‘1’) if all of its inputs are
low (‘0’).
• The output of OR gate is low (‘0’) if any of its inputs is
high (‘1’).
33. EX-OR & EX-
NOR Gates
One of the inputs of alternative gate will have a bubble
(which represents NOT gate).
For EX-OR structured original gate, alternative gate will be
EX-NOR structured.
For EX-NOR structured original gate, alternative gate will
be EX-OR structured.
If bubble is present at the output of original gate, then no
bubble will be present at the output of alternative gate.
If bubble is not present at the output of original gate, then
a bubble will be present at the output of alternative gate.