0% found this document useful (0 votes)
29 views29 pages

Number System and Logic Gates

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

Number System and Logic Gates

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

Number System

Binary Number System:


• In the binary system, numbers are represented using
only two digits: 0 and 1. Each digit in a binary number
is called a "bit" (short for binary digit). The position of
each bit represents a power of 2. The rightmost bit
represents 2^0, the next bit to the left represents 2^1,
then 2^2, and so on.
For example, let's take the binary number
101101:
1 0 1 1 0 1
2^5 2^4 2^3 2^2 2^1 2^0

To convert this binary number to decimal:


1⋅2^5+0⋅2^4+1⋅2^3+1⋅2^2+0⋅2^1+1⋅2^0=
32+0+8+4+0+1=45.
Hexadecimal System
• The hexadecimal (hex) number system uses base-16,
which means it has 16 symbols to represent values
from 0 to 15. These symbols are the regular decimal
digits 0 to 9, and the letters A to F, where A represents
10, B represents 11, and so on up to F representing 15.
Hexadecimal is particularly useful in digital systems,
memory addressing, and computer programming.
Conversion Between Hex and Decimal:
• To convert a hexadecimal number to decimal, you can multiply each
digit by 16^n, where n is the position of the digit (starting from 0 on
the right). Then sum up the results.

• For example, let's convert the hex number 1A3 to decimal


1 * 16^2 + 10 * 16^1 + 3 * 16^0 = 256 + 160 + 3 = 419
Decimal to Hex
• To convert a decimal number to hexadecimal, you can repeatedly
divide the decimal number by 16 and note the remainders. The
remainders, read in reverse order, give you the hexadecimal
equivalent.
• For example, let's convert the decimal number 315 to hexadecimal:
• 315 ÷ 16 = 19 remainder 11 (B)
• 19 ÷ 16 = 1 remainder 3
• 1 ÷ 16 = 0 remainder 1
Hex to Binary
• Converting between hexadecimal and binary is important in computer
science and digital systems. Let's go through both conversions step by
step:
• Hexadecimal to Binary Conversion:
• To convert a hexadecimal number to binary, you can follow these
steps:
1.Convert each hexadecimal digit to its equivalent 4-bit binary
representation. Use the following table:
Hex to Binary table
• Hex Binary •7 0111
•0 0000 •8 1000
•1 0001 •9 1001
•2 0010 •A 1010
•3 0011 •B 1011
•4 0100 •C 1100
•5 0101 •D 1101
•6 0110 •E 1110
•F 1111
Continuation…
1.Concatenate the binary representations of each hexadecimal digit.
• For example, let's convert the hexadecimal number 2F into binary:
• 2 in hexadecimal corresponds to 0010 in binary.
• F in hexadecimal corresponds to 1111 in binary.
• So, the binary equivalent of 2F is 00101111.
Binary to Hexadecimal Conversion:
• Converting binary to hexadecimal involves grouping the binary digits
in sets of four (starting from the right) and then finding the
corresponding hexadecimal value for each group. If the number of
digits isn't a multiple of four, you can pad with leading zeros.
1.Divide the binary number into groups of four digits each, starting
from the right.
2.Convert each group to its hexadecimal equivalent using the table
provided earlier.
Example:
• For example, let's convert the binary number 110101101010 to
hexadecimal:
• Grouping in fours: 1101 0110 1010
• Converting each group to hexadecimal: D 6 A
• So, the binary number 110101101010 is equivalent to DA in
hexadecimal.
• Conversions between binary and hexadecimal are particularly useful
in computer programming and digital systems, as hexadecimal is a
more compact representation for large binary values.
Hex in Programming
• Hexadecimal is often used in programming to represent memory
addresses, color codes, and other data structures. It's especially useful
when working with binary data because each hex digit corresponds to
four binary digits (bits).
• In summary, the hexadecimal system is a convenient way to represent
and work with binary data in a more human-readable form, making it
essential in fields like computer science and engineering.
Logic Gates

• Logic gates are fundamental building blocks


of digital circuits and form the basis of
digital logic design. They process binary
inputs (0s and 1s) to produce binary outputs
based on predefined logical functions. There
are several types of logic gates, each with its
own specific behavior.
AND Gate:
• 1. AND Gate: The AND gate takes two or more input signals and
produces an output signal only when all input signals are high (1). The
logic symbol for an AND gate looks like this:

• The output (Y) of the AND gate is 1 if and only if both inputs A and B
are 1.
OR Gate:
• The OR gate also takes two or more input signals and produces an
output signal when at least one input signal is high (1). The logic
symbol for an OR gate is:

• The output of the OR gate is 1 if any of the inputs A or B is 1.


NOT Gate:
• 3. The NOT gate (also called an inverter) has a single input and
produces the opposite output. It converts a high input (1) to a low
output (0) and vice versa. The logic symbol for a NOT gate is:

• The output of the NOT gate is the complement of the input A.


XOR Gate:
• The XOR gate (exclusive OR) takes two input signals and produces an
output signal that is high (1) when the number of input signals that are
high is odd. The logic symbol for an XOR gate is:

• The output of the XOR gate is 1 if the inputs A and B are different
(one is 0 and the other is 1).
NAND Gate:
• The NAND gate is a combination of an AND gate followed by a NOT
gate. It produces an output signal that is the inverse of the output from
the AND gate. The logic symbol for a NAND gate is:

• The output of the NAND gate is 0 only when both inputs A and B are 1.
NOR Gate:
• The NOR gate is a combination of an OR gate followed by a NOT
gate. It produces an output signal that is the inverse of the output from
the OR gate. The logic symbol for a NOR gate is:

• The output (Q) of the NOR gate is 1 only when both inputs A and B
are 0.
Boolean Algebra with Logic Gates
• Boolean algebra is a fundamental concept in digital circuit design and
computer science. It's a mathematical system that deals with binary
variables and logical operations. Here's a lesson on Boolean algebra:
• Boolean Variables: In Boolean algebra, variables can have one of two
values: 0 or 1. These values represent "false" and "true," respectively.
• 2. Logical Operators: There are three basic logical operators in
Boolean algebra:
• AND, OR and NOT
Laws of Boolean Algebra:
• Identity Law:
• A+0=A
• A.1=A
• Null Law
• A + A’ =1
• A .A’ =0
• Domination Law
• A + 1= 1
• A.0=0
• The Absorption Law
• A+(A⋅B)=A
• A.(A+B)=A
Laws of Boolean algebra

•Idempotent Laws:
•A + A = A
•A · A = A
•Commutative Laws:
•A + B = B + A
•A · B = B · A
•Associative Laws:
•(A + B) + C = A + (B + C)
•(A · B) · C = A · (B · C)
•Distributive Laws:
•A · (B + C) = (A · B) + (A · C)
•A + (B · C) = (A + B) · (A + C)
•De Morgan's Laws:
•(A + B)' = A' · B'
•(A · B)' = A' + B'
Variables:

Boolean Expressions: Boolean expressions are


combinations of variables and logical operators. For
example:
•A · B + C' is a Boolean expression involving the AND,
OR, and NOT operators.
5. Simplification: You can simplify Boolean expressions
using the laws mentioned above. For example:
Simplify A · (A + B):
Karnaugh map:
• A Karnaugh map (K-map) is a graphical representation used
for simplifying Boolean algebra expressions and optimizing
digital logic circuits. It provides a visual and systematic
method for minimizing the number of gates needed in a
circuit by identifying patterns of 1s in a truth table. K-maps
are especially useful for simplifying Boolean expressions
with multiple variables.
Here's an explanation of how Karnaugh maps work, along with an
example:

• Karnaugh Map Basics:


1.Table Format: A K-map is a two-dimensional grid where each cell
represents a unique combination of input values for a Boolean
expression. The number of rows and columns in the map depends on
the number of input variables.
2.Input Variables: Suppose you have an expression with n input
variables (e.g., A, B, C, etc.). You will need a K-map with 2^n cells.
3.Truth Table: To create a K-map, you start with the truth table for your
Boolean expression. The truth table lists all possible input
combinations and the corresponding output values (0 or 1).
Let's work with a simple example using a 2-
variable expression: F(A, B) = A'B + AB'
• Create the K-Map: For a 2-variable expression, you'll have a 2x2 K-
map (4 cells).
Fill in the Map:
• Use the truth table to fill in the map. Mark the cells with 1s where the
expression is true and leave the rest blank.

In the map, we placed X in the cell corresponding to A=1, B=1 because


F(A=1, B=1) = 1 according to the truth table.
1.Group adjacent 1s: Look for groups of adjacent 1s (2, 4, 8, etc.) in the K-
map. You can group horizontally or vertically, but not diagonally or across the
edges.
2.In this example, there are two groups of two adjacent 1s:
3.Group 1: (0,1) and (1,0)
4.Write the simplified expression: Each group of 1s corresponds to a term in
the simplified Boolean expression. Write down the terms for each group.
5.Group 1: A'B
• So, the simplified Boolean expression is: F(A, B) = A'B, which represents the
same logic as the original expression A'B + AB'. K-maps help simplify
complex expressions for efficient digital circuit design.

You might also like