Let S Embark
Let S Embark
systems and logic families. This field forms the bedrock of all modern electronic
devices, from smartphones to supercomputers, by representing and processing
information using discrete states.
1
1. AND Operation: The output is TRUE (1) only if all inputs are TRUE
(1). Otherwise, the output is FALSE (0).
• Boolean Expression: F = A · B (or simply F = AB)
• Logic Gate Symbol:
• A -----\
>-D-- F
B -----/
• Truth Table (2 inputs, A and B):
A B F (A AND B)
0 0 0
0 1 0
1 0 0
1 1 1
A B F (A OR B)
0 0 0
0 1 1
1 0 1
1 1 1
2
• Truth Table (1 input, A):
A F (NOT A)
0 1
1 0
4. NAND Operation (NOT AND): The output is FALSE (0) only if all
inputs are TRUE (1). It's the inverse of the AND operation. NAND gates
are considered "universal gates" because any other logic gate (AND, OR,
NOT, NOR, XOR) can be constructed using only NAND gates.
• Boolean Expression: F = A · B
• Logic Gate Symbol:
• A -----\
>-Do-- F
B -----/
• Truth Table (2 inputs, A and B):
A B F (A NAND B)
0 0 1
0 1 1
1 0 1
1 1 0
5. NOR Operation (NOT OR): The output is TRUE (1) only if all inputs
are FALSE (0). It's the inverse of the OR operation. NOR gates are also
"universal gates."
• Boolean Expression: F = A + B
• Logic Gate Symbol:
• A -----\
>o-- F
B -----/
• Truth Table (2 inputs, A and B):
A B F (A NOR B)
0 0 1
0 1 0
1 0 0
1 1 0
3
6. Exclusive-OR (XOR) Operation: The output is TRUE (1) if the
inputs are different. The output is FALSE (0) if the inputs are the same.
• Boolean Expression: F = A ⊕ B = AB + AB
• Logic Gate Symbol:
• A ----=\
>-- F
B ----=/
• Truth Table (2 inputs, A and B):
A B F (A XOR B)
0 0 0
0 1 1
1 0 1
1 1 0
Boolean Algebra
Boolean algebra is a mathematical system developed by George Boole for an-
alyzing and simplifying logic circuits. It operates with variables that can only
have two values (0 or 1) and logical operations (AND, OR, NOT).
Key Theorems and Laws:
• Identity Law: A · 1 = A, A + 0 = A
• Null Law: A · 0 = 0, A + 1 = 1
• Idempotent Law: A · A = A, A + A = A
• Complementary Law: A · A = 0, A + A = 1
• Involution Law (Double Inversion): A = A
• Commutative Law: A · B = B · A, A + B = B + A
• Associative Law: (A · B) · C = A · (B · C), (A + B) + C = A + (B + C)
• Distributive Law: A · (B + C) = (A · B) + (A · C), A + (B · C) =
(A + B) · (A + C)
• Absorption Law: A + AB = A, A · (A + B) = A
• De Morgan's Theorems: These are extremely important for circuit
simplification and for showing the universality of NAND/NOR gates.
– A · B = A + B (The complement of a product is the sum of the
complements)
– A + B = A · B (The complement of a sum is the product of the
complements)
Example of Simplification using Boolean Algebra: Simplify F = AB +AB
F = A(B + B) (Distributive Law) F = A(1) (Complementary Law) F = A
(Identity Law) This shows that the circuit represented by AB + AB can be
simplified to just a single wire (connecting input A to output F).
4
Examples of IC Gates
Integrated Circuits (ICs) are chips that contain multiple logic gates fabricated
on a single semiconductor substrate. These are often part of standard "logic
families" (like the 7400 series or 4000 series).
Common Examples (from the 7400 series, specifically the LS sub-
family):
• 74LS00: Quad 2-input NAND Gate (contains four independent 2-input
NAND gates in one package).
• 74LS02: Quad 2-input NOR Gate.
• 74LS04: Hex Inverter (contains six independent NOT gates).
• 74LS08: Quad 2-input AND Gate.
• 74LS32: Quad 2-input OR Gate.
• 74LS86: Quad 2-input XOR Gate.
Diagram: Pinout Example for 74LS00 Quad 2-Input NAND Gate IC
VCC ---(14)
|
1A ---[1] [14]--- VCC
1B ---[2] [13]--- 4B
1Y ---[3] [12]--- 4A
2A ---[4] [11]--- 4Y
2B ---[5] [10]--- 3B
2Y ---[6] [9]---- 3A
GND ---[7] [8]---- 3Y
|
(Pin numbers)
• Each numbered rectangle represents a pin.
• 1A, 1B are inputs for the first NAND gate, 1Y is its output.
• VCC is the power supply, GND is ground.
Number Systems
Digital systems heavily rely on different number systems for representation and
processing.
1. Binary (Base-2): Uses only two digits: 0 and 1. This is the native
language of digital circuits.
• Example: 10112 (binary) = 1·23 +0·22 +1·21 +1·20 = 8+0+2+1 =
1110 (decimal).
2. Decimal (Base-10): The everyday number system we use, with digits
0-9.
3. Octal (Base-8): Uses digits 0-7. Often used as a concise way to represent
binary numbers because three binary digits map directly to one octal digit
5
(23 = 8).
• Example: 178 (octal) = 1 · 81 + 7 · 80 = 8 + 7 = 1510 (decimal).
• Binary to Octal: Group binary bits in threes from the right:
011 111 0012 = 3718 .
4. Hexadecimal (Base-16): Uses digits 0-9 and letters A-F (where A=10,
B=11, C=12, D=13, E=14, F=15). Widely used as a shorthand for binary
in computing because four binary digits map directly to one hexadecimal
digit (24 = 16).
• Example: 2A16 (hex) = 2 · 161 + 10 · 160 = 32 + 10 = 4210 (decimal).
• Binary to Hexadecimal: Group binary bits in fours from the right:
0111 0010 11012 = 72D16 .
Binary Arithmetic
Performing arithmetic operations with binary numbers is fundamental for digital
processing.
• Binary Addition: Similar to decimal addition, but with carries at 2
instead of 10.
– 0+0=0
– 0+1=1
– 1+0=1
– 1 + 1 = 0 (and carry 1 to the next position)
• Example: Binary Addition
1 1 <-- Carry bits
0 1 1 0 (6)
+ 0 1 1 1 (7)
---------
1 1 0 1 (13)
• Binary Subtraction: Can be done directly, but is more commonly per-
formed in digital systems using complements (especially two's complement)
because it allows subtraction to be implemented as addition.
• Binary Multiplication: Similar to long multiplication in decimal, but
using only 0s and 1s.
• Binary Division: Similar to long division in decimal.
6
• Representation: To find the one's complement of a binary number,
simply invert all the bits (0 becomes 1, 1 becomes 0). The leftmost
bit (MSB) is often used as a sign bit (0 for positive, 1 for negative).
• Example (4-bit):
– 01012 = +510
– One's complement of 01012 is 10102 , which represents −510 .
• Arithmetic: When adding, if a carry-out is generated from the MSB,
it is "end-around carried" and added to the LSB.
• Disadvantage: Has two representations for zero (00002 and 11112
for positive and negative zero respectively).
2. Two's Complement:
• Representation: The most widely used method for representing
signed numbers in digital systems. To find the two's complement of
a binary number, take its one's complement and then add 1 to the
result.
• Example (4-bit):
– 01012 = +510
– One's complement of 01012 is 10102 .
– Add 1: 10102 + 12 = 10112 . This represents −510 .
• Arithmetic: Addition and subtraction are performed using the same
hardware (subtraction is simply adding the two's complement of the
subtrahend). The carry-out from the MSB is simply discarded.
• Advantages:
– Only one representation for zero (00002 ).
– Simplifies arithmetic circuits, as addition and subtraction use the
same logic.
– Handles positive and negative numbers seamlessly in standard
binary addition.
• Example: Subtraction using Two's Complement (7 − 5 = 2) As-
suming 4-bit numbers: 710 = 01112 510 = 01012 Find two's complement of
510 (01012 ):
a. One's complement: 10102
b. Add 1: 10102 + 12 = 10112 (This is −510 )
Now, add 710 and −510 :
0 1 1 1 (+7)
+ 1 0 1 1 (-5)
---------
(1)0 0 1 0 (Discard MSB carry-out)
Result: 00102 = +210 .
7
Codes
Codes are schemes for representing information using specific binary patterns.
• BCD (Binary-Coded Decimal): Each decimal digit (0-9) is represented
by its 4-bit binary equivalent. This is not the same as converting an entire
decimal number to binary.
– Example: 3910 in BCD is 0011 1001BCD (not 1001112 ).
– Application: Used in digital displays (e.g., calculators, clocks) where
direct decimal representation is convenient.
• Gray Code: A unique code where only one bit changes between successive
numbers.
– Example (3-bit Gray Code):
∗ 000 (0)
∗ 001 (1)
∗ 011 (2)
∗ 010 (3)
∗ 110 (4)
∗ 111 (5)
∗ 101 (6)
∗ 100 (7)
– Application: Used in rotary encoders and Karnaugh maps to min-
imize errors during transitions, as only one bit changes at a time,
preventing ambiguous intermediate states.
• ASCII (American Standard Code for Information Interchange):
An 7-bit or 8-bit code used to represent characters (letters, numbers,
symbols, control codes) in computers and communication systems. Each
character has a unique binary code.
– Example: ASCII for 'A' is 010000012 , 'a' is 011000012 .
8
∗ Even Parity: Count of 1s is 3. Add P=1 to make it 4. Transmit
10111.
∗ Odd Parity: Count of 1s is 3. Add P=0 to keep it 3. Transmit
10110.
• Hamming Codes: More sophisticated codes that can not only detect
multiple-bit errors but also correct single-bit errors. They strategically
place parity bits within the data block to identify the exact position of an
error.
– Application: Memory (RAM) error correction.
• Cyclic Redundancy Check (CRC): Used widely in digital networks
(Ethernet, Wi-Fi) and storage devices (hard drives) for robust error detec-
tion. It generates a short, fixed-length binary sequence (CRC checksum)
for each block of data using polynomial division. The receiver performs
the same calculation and compares the checksums.
– Detection: Highly effective at detecting common types of errors
(burst errors).
9
3. Fan-out: The maximum number of inputs of identical logic gates that a
single gate's output can drive reliably without degrading its output logic
level or speed. A high fan-out is desirable.
4. Fan-in: The number of inputs a logic gate can accept.
5. Noise Margin (VN H , VN L ): The maximum amount of unwanted noise
voltage that can be present at the input of a gate without causing an
erroneous output. It's the difference between the worst-case output voltage
of a driving gate and the minimum/maximum input voltage required by
the driven gate. Higher noise margin means better immunity to electrical
noise. Diagram: Noise Margins (Conceptual)
• Voltage
ˆ
| V_OH (Min. High Output)
|------------------------- (Driving Gate's Output HIGH)
| V_IH (Min. High Input)
|------------------
| Noise Margin HIGH (V_NH)
| V_IL (Max. Low Input)
|------------------
| V_OL (Max. Low Output)
|------------------------- (Driving Gate's Output LOW)
| Noise Margin LOW (V_NL)
+------------------------>
6. Operating Voltage: The specified range of power supply voltage (e.g.,
4.75V to 5.25V for 5V TTL).
7. Operating Temperature Range: The temperature range over which
the IC functions reliably.
10
• Diagram: Simplified TTL NAND Gate Output (Totem-Pole)
VCC
|
|
+----R_pull-up----+
| |
| [Transistor Q1 (Upper)]
| |
Output (Y)--------+
| |
| [Transistor Q2 (Lower)]
| |
+-----------------+
GND
– When output is HIGH, Q1 is ON, Q2 is OFF.
– When output is LOW, Q1 is OFF, Q2 is ON.
• Characteristics:
– Voltage Levels (5V Vcc):
∗ Logic '0' (LOW): 0V to 0.8V (VOLmax = 0.4V , VILmax = 0.8V )
∗ Logic '1' (HIGH): 2V to 5V (VOHmin = 2.4V , VIHmin = 2.0V )
– Speed: Relatively fast (standard TTL: ~10ns propagation delay).
– Power Dissipation: Higher compared to CMOS (draws significant
current even when static).
– Noise Margin: Moderate (~0.4V).
– Output Drive Capability: Good fan-out, especially for sinking
current (LOW state).
– Current Sinking: TTL inputs require current to be sunk (pulled
low) to be recognized as a '0'. This is important for interfacing.
– Sub-families: Standard TTL (74xx), Low-Power TTL (L), High-
Speed TTL (H), Schottky TTL (S, LS, ALS, F).
11
|
| +---- Diode (Schottky)
| | (from Base to Collector)
| v
Base (B)----|>|----
| |
+-----NPN Transistor-----+
| |
Emitter (E)--------+
• Sub-families:
– S-TTL (Schottky TTL): Faster than standard TTL, but higher
power.
– LS-TTL (Low-Power Schottky TTL): The most popular and
widely used TTL sub-family. It offers a good balance of speed and sig-
nificantly lower power dissipation than standard TTL or S-TTL. It be-
came a workhorse for many digital designs due to its cost-effectiveness
and performance ( 5 − 10ns).
– ALS-TTL (Advanced Low-Power Schottky TTL) and F-TTL
(Fast TTL): Further improvements offering even better speed-power
products ( 2 − 5ns).
12
|
GND ----+
– When Input = 0: Q1 is ON, Q2 is OFF. Output = VCC (HIGH).
– When Input = 1: Q1 is OFF, Q2 is ON. Output = GND (LOW).
• Characteristics:
– Voltage Levels: Very wide operating voltage range, typically from 2V
to 15V (for older 4000 series) or 1.8V to 5.5V (for modern 74HC/HCT
series).
∗ Logic '0' (LOW): 0V to ~0.3 * Vcc
∗ Logic '1' (HIGH): ~0.7 * Vcc to Vcc
∗ Outputs swing very close to Vcc and GND.
– Power Dissipation: Extremely low static power dissipation (when
not switching). Power consumption increases with switching frequency
(dynamic power). This is its biggest advantage for battery-powered
devices and high-density ICs.
– Speed: Generally slower than TTL at higher loads (due to output
capacitance), but modern CMOS processes are incredibly fast and
dominate high-speed applications.
– Noise Margin: Excellent noise margin, typically 45% of the supply
voltage.
– Output Drive Capability: Can drive a large number of inputs
(high fan-out) due to high input impedance.
– Input Impedance: Very high input impedance (MOSFET gates are
insulated), meaning they draw very little current from the driving
circuit.
– Susceptibility to Static Discharge (ESD): Older CMOS devices
were sensitive to static electricity due to their high input impedance,
but modern devices have robust ESD protection circuits.
13
is often directly compatible. However, for robust operation or if the
CMOS VCC is higher than 5V, a pull-up resistor (connected from
TTL output to CMOS VCC ) might be needed to raise the TTL HIGH
output voltage closer to the CMOS VCC to guarantee a solid HIGH.
– Current: TTL typically sources little current for HIGH but sinks
more for LOW. CMOS inputs draw very little current, so current is
usually not an issue.
• Diagram: TTL driving CMOS with Pull-up Resistor (if needed)
+------+ +------+
TTL Gate| |----------| | CMOS Gate
| |---R_pullup --- Vcc(CMOS)
+------+ +------+
• CMOS driving TTL:
– Voltage: A CMOS output '0' (close to 0V) is perfectly fine for TTL
'0'. A CMOS output '1' (close to VCC ) is also fine for TTL '1'.
– Current Sinking: This is the main potential issue. TTL inputs
require a significant amount of current to be sunk (pulled low) to be
recognized as a '0'. Standard CMOS outputs (like 4000 series) may
not be able to sink enough current to reliably pull a TTL input to a
valid LOW level, especially if driving multiple TTL inputs.
∗ Solution 1: 74HCT (High-Speed CMOS, TTL-
compatible): These CMOS devices have input voltage levels
and output current capabilities specifically designed to be directly
compatible with TTL. Their VIHmin and VILmax levels are
designed to match TTL, and their output sink current capability
is increased.
∗ Solution 2: Current Buffer/Level Shifter: Use a dedicated
buffer IC or a specific CMOS driver gate with higher sink current
capability.
• Diagram: CMOS driving TTL (often direct if 74HCT, or with
care)
+------+ +------+
CMOS Gate| |----------| | TTL Gate
| | | |
+------+ +------+
Tri-state Logic
Tri-state (or three-state) logic introduces a third output state in addition to the
standard '0' (LOW) and '1' (HIGH):
• High (1): The output is at a high voltage level.
• Low (0): The output is at a low voltage level.
14
• High-impedance (Z): The output is effectively disconnected from the
circuit. It acts like an open circuit, neither sourcing nor sinking current. In
this state, the output effectively looks like a very high resistance, preventing
it from interfering with other devices connected to the same line.
Logic Gate Symbol (Tri-state Buffer):
Data Input (A) -----[ Buffer ]---- Output (Y)
[ ]
Enable Input (E) -----[ Control]
Truth Table for Tri-state Buffer:
15
• Memory Interfacing: Used to enable/disable memory chips or their
outputs on a data bus, ensuring controlled access.
This detailed explanation provides a robust foundation in the fundamentals of
digital systems and their underlying logic families, complete with illustrative
diagrams.
16