Digital Logic Fundamentals: Number Systems, BCD, and K-Maps
Number System Basics and Computer Use
(a) What is a Number System?
A number system is a way of representing numbers using a set of symbols and a base (radix). Examples include:
- Decimal (base 10)
- Binary (base 2)
- Octal (base 8)
- Hexadecimal (base 16)
b) Why Digital Computers Use Binary Number System?
Digital computers use binary because:
- Electronic circuits have two states: ON (1) and OFF (0).
- Binary is reliable and easy to implement.
- It results in less error in data processing.
(c) Convert (1001.0010)โ to Decimal
Integer part:
$1001_2 = 1\times2^3 + 0\times2^2 + 0\times2^1 + 1\times2^0 = 8 + 0 + 0 + 1 = 9_{10}$
Fractional part:
$.0010_2 = 0\times2^{-1} + 0\times2^{-2} + 1\times2^{-3} + 0\times2^{-4} = 0 + 0 + 0.125 + 0 = 0.125_{10}$
โ Answer = 9.125
Combinational vs. Sequential Circuits
(d) Difference between Combinational & Sequential Circuits
| Combinational | Sequential |
|---|---|
| Output depends on present input | Output depends on present input + past state |
| No memory | Has memory |
| Example: Adder | Example: Flip-Flop |
(e) What is Flip-Flop?
A flip-flop is a memory element that stores 1 bit of data. Types include: SR, JK, D, T Flip-Flop.
(f) What is Encoder?
An encoder converts multiple inputs into fewer outputs. Example: 8-to-3 encoder.
(g) What are SISO and PISO?
SISO: Serial In Serial Out
PISO: Parallel In Serial Out
Both are types of shift registers.
(h) What is ROM?
ROM (Read Only Memory) is a non-volatile memory used to store permanent data like BIOS.
What are BCD Codes? Explain in detail.
(14 Marks โ 500+ Words Answer)
๐น Introduction
In digital electronics and computer systems, information is processed in binary form. However, humans are more comfortable using decimal numbers. To bridge this gap between human-readable decimal numbers and machine-readable binary numbers, special coding systems are used. One such important coding system is the Binary Coded Decimal (BCD) code.
๐น Definition of BCD Code
Binary Coded Decimal (BCD) is a digital coding system in which each decimal digit (0 to 9) is represented separately by its equivalent 4-bit binary number. Unlike pure binary representation, BCD does not convert the entire number into binary; instead, it converts each decimal digit individually.
๐น BCD Representation Table
| Decimal Digit | BCD Code |
|---|---|
| 0 | 0000 |
| 1 | 0001 |
| 2 | 0010 |
| 3 | 0011 |
| 4 | 0100 |
| 5 | 0101 |
| 6 | 0110 |
| 7 | 0111 |
| 8 | 1000 |
| 9 | 1001 |
Digits from 1010 to 1111 are invalid in BCD.
Working of BCD Code
In BCD, every decimal digit is encoded separately into a 4-bit binary form.
Example:
Convert decimal number 59 into BCD.
- 5 โ 0101
- 9 โ 1001
So, BCD of 59 = 0101 1001
This method makes conversion between decimal and binary easier compared to pure binary systems.
๐น Types of BCD Codes
- 8421 BCD Code โ Most commonly used
- 2421 Code
- Excess-3 Code
Among these, 8421 BCD code is the standard BCD used in computers.
๐น Advantages of BCD Code
- Easy Decimal Conversion: Since each digit is separately represented, conversion between decimal and BCD is simple.
- Human-Friendly Representation: BCD closely matches human decimal numbering.
- Accurate Display: Widely used in calculators, digital clocks, and meters.
- Less Conversion Error: Avoids rounding errors common in binary fractions.
๐น Disadvantages of BCD Code
- Requires More Storage: BCD uses more bits than pure binary.
- Complex Arithmetic Operations: BCD addition and subtraction require correction logic.
- Inefficient for Large Numbers: Not suitable for high-speed arithmetic processing.
๐น Applications of BCD Code
- Digital calculators
- Electronic clocks
- Digital voltmeters
- Seven segment displays
- Banking and financial systems
๐น Comparison: BCD vs Binary
| Feature | BCD | Binary |
|---|---|---|
| Storage | High | Low |
| Speed | Slower | Faster |
| Accuracy | High | Medium |
| Human Readability | Easy | Difficult |
๐น Conclusion
Binary Coded Decimal (BCD) code plays a vital role in digital systems where decimal accuracy and display clarity are important. Although it is less efficient in terms of storage and speed compared to pure binary systems, its ease of conversion and human-friendly nature make it ideal for calculators, digital displays, and financial applications. Therefore, BCD continues to be an important concept in the logical organization of computers.
What is K-Map? Simplify Boolean Expression using K-Map and realize it using NAND Gates.
(14 Marks โ 500+ Words + Diagrams)
๐น Introduction
In digital electronics, Boolean expressions are used to design logic circuits. Complex Boolean expressions require a large number of logic gates, which increases hardware cost and delay. To reduce this complexity, a systematic simplification technique called Karnaugh Map (K-Map) is used. K-Map provides a graphical method to simplify Boolean expressions and obtain minimal logic circuits.
๐น Definition of Karnaugh Map (K-Map)
A Karnaugh Map (K-Map) is a graphical representation of Boolean expressions that helps in simplifying logic functions by grouping adjacent minterms. It is based on Gray code ordering, where only one variable changes between adjacent cells.
๐น Features of K-Map
- Visual method of simplification
- Reduces number of logic gates
- Uses Gray code sequence
- Suitable for up to 4โ6 variables
๐น 2-Variable K-Map Diagram
B
0 1
+---+---+
A 0 | 0 | 1 |
+---+---+
1 | 1 | 1 |
+---+---+
๐ Adjacent 1s are grouped to simplify expression.
๐น 3-Variable K-Map Diagram
BC
00 01 11 10
+----+----+----+----+
A 0 | | | | |
+----+----+----+----+
1 | | | | |
+----+----+----+----+
๐น Steps to Simplify Boolean Expression using K-Map
- Draw K-map according to number of variables
- Enter given minterms
- Form groups of 1, 2, 4, 8 cells
- Choose largest possible groups
- Write simplified Boolean expression
๐น Example (Conceptual)
Let the Boolean function be:
F(A,B,C) = ฮฃ(1,3,5,7)
After grouping all 1s in K-map, the simplified expression becomes:
F = C
(Explanation: all minterms have C = 1)
๐น NAND Gate Realization
๐ธ Definition of NAND Gate
A NAND gate is a universal gate whose output is LOW only when all inputs are HIGH.
๐น Symbol of NAND Gate (Text Diagram)
A ----|\
| )o---- Y
B ----|/
๐น Why NAND is called Universal Gate?
- Any logic gate (AND, OR, NOT) can be built using NAND only
- Reduces hardware variety
๐น NAND Gate Realization Diagram (Conceptual)
A ----|\
| )o----|
B ----|/ |\
| )o---- Output
C --------------|/
(All gates shown are NAND gates)
๐น Advantages of K-Map
- Simple and systematic
- Minimizes logic cost
- Reduces power consumption
- Improves circuit speed
๐น Limitations of K-Map
- Not suitable for very large variables
- Manual method
- Error-prone if grouping is incorrect
๐น Applications of K-Map
- Digital circuit design
- CPU logic optimization
- Memory decoding
- Control circuits
๐น Conclusion
Karnaugh Map is one of the most powerful and widely used techniques for simplifying Boolean expressions. By reducing the number of terms and logic gates, K-Map helps in designing efficient, cost-effective, and high-speed digital circuits. The use of NAND gates further enhances flexibility, as NAND is a universal gate capable of implementing any logic function.
What are Logic Gates? Explain all Logic Gates with truth tables and logic symbols.
(14 Marks โ 500+ Words + Diagrams)
๐น Introduction
In digital electronics and computer systems, all operations are performed using binary data (0 and 1). The basic building blocks that perform logical operations on binary inputs are called logic gates. Logic gates form the foundation of digital circuits, computers, microprocessors, and communication systems. Every complex digital system is ultimately constructed using combinations of logic gates.
๐น Definition of Logic Gate
A logic gate is an electronic circuit that takes one or more binary inputs and produces a single binary output according to a specific logical rule. The output of a logic gate depends on the type of gate and the input combination applied to it.
๐น Importance of Logic Gates
- Building blocks of digital circuits
- Used in CPU, ALU, memory and control units
- Enable decision making in digital systems
- Essential for data processing and storage
๐น Types of Logic Gates
Logic gates are mainly classified into three categories:
- Basic Gates
- Universal Gates
- Exclusive Gates
๐น 1๏ธโฃ AND Gate
Definition
An AND gate produces output HIGH (1) only when all inputs are HIGH.
Boolean Expression
Y = A ยท B
Truth Table
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Logic Symbol (Diagram)
A ----|\
| )---- Y
B ----|/
๐น 2๏ธโฃ OR Gate
Definition
An OR gate gives output HIGH when any one input is HIGH.
Boolean Expression
Y = A + B
Truth Table
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Logic Symbol
A ----\
)---- Y
B ----/
๐น 3๏ธโฃ NOT Gate
Definition
A NOT gate inverts the input.
Boolean Expression
Y = ‾A
Truth Table
| A | Y |
|---|---|
| 0 | 1 |
| 1 | 0 |
Logic Symbol
A ----|>o---- Y
๐น 4๏ธโฃ NAND Gate (Universal Gate)
Definition
A NAND gate is the inverse of AND gate.
Boolean Expression
Y = ‾A ยท B
Truth Table
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Logic Symbol
A ----|\
| )o---- Y
B ----|/
๐น 5๏ธโฃ NOR Gate (Universal Gate)
Definition
A NOR gate is the inverse of OR gate.
Boolean Expression
Y = ‾A + B
Truth Table
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Logic Symbol
A ----\
)o---- Y
B ----/
๐น 6๏ธโฃ XOR Gate
Definition
An XOR gate produces output HIGH when inputs are different.
Boolean Expression
Y = A โ B
Truth Table
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Logic Symbol
A ----\
))---- Y
B ----/
๐น 7๏ธโฃ XNOR Gate
Definition
An XNOR gate produces output HIGH when inputs are same.
Boolean Expression
Y = ‾A โ B
Truth Table
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Logic Symbol
A ----\
))o---- Y
B ----/
๐น Applications of Logic Gates
- Arithmetic circuits (adders, subtractors)
- Control systems
- Memory circuits
- Digital communication
๐น Conclusion
Logic gates are the fundamental components of digital electronics. Every digital system, from simple calculators to complex computers, is built using combinations of logic gates. Understanding logic gates is essential for learning the logical organization of computers and digital system design.
Logic Symbol (OR Gate Example Repetition)
A ----\
)---- Y
B ----/
What do you mean by Sequential Circuits? Explain Shift Registers in detail.
(14 Marks โ 500+ Words, NO diagram as not demanded)
๐น Introduction
Digital circuits are broadly classified into combinational and sequential circuits. While combinational circuits depend only on present inputs, sequential circuits depend on both present inputs and previous outputs. This property makes sequential circuits capable of storing information. Sequential circuits are an essential part of computer systems and are widely used in memory elements, registers, counters, and control units.
๐น Definition of Sequential Circuits
A sequential circuit is a type of digital circuit in which the output depends not only on the present input values but also on the previous state of the circuit. This previous state is stored using memory elements such as flip-flops.
๐น Characteristics of Sequential Circuits
- Presence of memory elements
- Output depends on past and present inputs
- Operates with clock signals
- More complex than combinational circuits
๐น Difference between Combinational and Sequential Circuits
| Combinational Circuit | Sequential Circuit |
|---|---|
| No memory | Has memory |
| Depends only on input | Depends on input and past output |
| Faster | Slower |
| Example: Adder | Example: Counter |
๐น Shift Registers
A shift register is a sequential circuit used to store and shift data. It consists of a group of flip-flops connected in series, where data moves from one flip-flop to another on each clock pulse.
๐น Types of Shift Registers
1๏ธโฃ Serial In Serial Out (SISO)
Data enters and exits serially, one bit at a time.
2๏ธโฃ Serial In Parallel Out (SIPO)
Data enters serially but output is obtained in parallel form.
3๏ธโฃ Parallel In Serial Out (PISO)
Data enters in parallel and exits serially.
4๏ธโฃ Parallel In Parallel Out (PIPO)
Data enters and exits in parallel form.
๐น Applications of Shift Registers
- Data transfer
- Temporary data storage
- Serial communication
- Timing circuits
๐น Advantages of Shift Registers
- Simple design
- Efficient data handling
- Used in data conversion
๐น Limitations of Shift Registers
- Limited storage
- Slower compared to RAM
๐น Conclusion
Sequential circuits provide memory and timing control in digital systems. Shift registers, being an important type of sequential circuit, play a vital role in data storage and transfer operations in computer systems.
What are Counters? Explain all types of Counters.
(14 Marks โ 500+ Words, Theory Only)
๐น Introduction
In digital systems, counting operations are required in many applications such as digital clocks, timers, frequency measurement, and event counting. For this purpose, a special type of sequential circuit called a counter is used. Counters play a crucial role in the logical organization of computers and digital electronics.
๐น Definition of Counter
A counter is a sequential digital circuit that counts the number of clock pulses applied to its input. With each clock pulse, the counter changes its state in a predefined sequence. Since counters store previous states, they are implemented using flip-flops.
๐น Basic Characteristics of Counters
- Counters are sequential circuits
- They require a clock signal
- They are built using flip-flops
- Output depends on present and previous states
๐น Classification of Counters
Counters are broadly classified into:
- Asynchronous Counters
- Synchronous Counters
๐น 1๏ธโฃ Asynchronous Counter (Ripple Counter)
In an asynchronous counter, the clock pulse is applied only to the first flip-flop. The output of one flip-flop acts as the clock input for the next flip-flop.
Features:
- Simple design
- Slow operation due to ripple delay
- Used in low-speed applications
Example:
4-bit ripple counter
๐น 2๏ธโฃ Synchronous Counter
In a synchronous counter, the clock signal is applied simultaneously to all flip-flops. All flip-flops change state at the same time.
Features:
- Faster than asynchronous counter
- More complex design
- Used in high-speed circuits
๐น 3๏ธโฃ Up Counter
An up counter counts in an increasing order.
Counting Sequence Example:
0000 โ 0001 โ 0010 โ 0011 โ โฆ โ 1111
Application:
Digital clocks, timers
๐น 4๏ธโฃ Down Counter
A down counter counts in a decreasing order.
Counting Sequence Example:
1111 โ 1110 โ 1101 โ 1100 โ โฆ โ 0000
Application:
Countdown timers, lift control systems
๐น 5๏ธโฃ Up/Down Counter
An up/down counter can count both upward and downward depending on a control signal.
Application:
Industrial control systems
๐น 6๏ธโฃ Mod-N Counter
A Mod-N counter counts from 0 to (Nโ1) and then resets to 0.
Example:
Mod-10 counter (Decade counter)
Application:
Digital clocks, frequency division
๐น Applications of Counters
- Digital clocks
- Event counters
- Frequency measurement
- Timing and control systems
๐น Advantages of Counters
- Accurate counting
- Easy to implement
- Useful in timing operations
๐น Limitations of Counters
- Limited counting speed (asynchronous)
- Design complexity (synchronous)
๐น Conclusion
Counters are essential components of digital systems used for counting and timing purposes. Depending on the application, different types of counters such as asynchronous, synchronous, up, down, and mod-N counters are used. Their importance in computer organization and digital electronics makes them a fundamental topic in the study of Logical Organization of Computers.
What are I/O Devices? Explain their Controllers in detail.
(14 Marks โ 500+ Words, Theory Only)
๐น Introduction
A computer system does not work in isolation. It continuously interacts with users and external devices to receive data, process it, and provide results. These interactions are made possible through Input/Output (I/O) devices. I/O devices act as a communication bridge between the computer system and the external world. To manage and control these devices efficiently, a special hardware unit called an I/O controller is used.
๐น Definition of I/O Devices
Input/Output (I/O) devices are hardware components that enable a computer system to accept input data, produce output, and store information. These devices allow users to interact with the computer and make the system useful for real-world applications.
๐น Types of I/O Devices
1๏ธโฃ Input Devices
Input devices are used to enter data and instructions into the computer.
Examples:
- Keyboard
- Mouse
- Scanner
- Microphone
- Webcam
These devices convert human-readable information into machine-readable form.
2๏ธโฃ Output Devices
Output devices display the processed data in a readable form.
Examples:
- Monitor
- Printer
- Speaker
- Plotter
These devices convert machine-processed data into human-readable form.
3๏ธโฃ Storage Devices
Storage devices are used to store data permanently or temporarily.
Examples:
- Hard Disk
- Pen Drive
- CD/DVD
๐น Need for I/O Controllers
Direct communication between CPU and I/O devices is inefficient because:
- I/O devices are slower than CPU
- Data formats are different
- CPU cannot manage multiple devices simultaneously
To overcome these problems, I/O controllers are used.
๐น Definition of I/O Controller
An I/O controller is a hardware component that acts as an interface between the CPU and I/O devices. It manages data transfer, controls device operations, and reduces the burden on the CPU.
๐น Functions of I/O Controller
- Controls data flow between CPU and I/O devices
- Converts serial data to parallel data and vice versa
- Monitors the status of I/O devices
- Generates interrupt signals after task completion
- Handles error detection and correction
๐น Components of I/O Controller
1๏ธโฃ Data Register
Stores data temporarily during data transfer.
2๏ธโฃ Control Register
Holds control commands issued by the CPU.
3๏ธโฃ Status Register
Indicates device status such as ready, busy, or error.
๐น Working of I/O Controller
- CPU sends command to I/O controller
- Controller activates the I/O device
- Data transfer takes place
- Controller updates status register
- Interrupt signal is sent to CPU after completion
๐น Advantages of I/O Controllers
- Reduces CPU workload
- Improves system efficiency
- Allows parallel processing
- Ensures proper device management
๐น Applications of I/O Devices and Controllers
- Computer peripherals
- Data communication systems
- Industrial automation
- Embedded systems
๐น Conclusion
I/O devices play a vital role in enabling communication between a computer system and the external environment. The I/O controller acts as an intelligent intermediary that manages device operations, improves system efficiency, and allows smooth data transfer. Without I/O devices and controllers, a computer system would be unable to interact with users or perform practical tasks.
What do you mean by Interrupt? Explain Interrupt structure and its types with example.
(14 Marks โ 500+ Words, Theory Only)
๐น Introduction
In a computer system, the CPU executes instructions one by one in a sequential manner. However, during execution, certain situations arise that require immediate attention, such as input from a keyboard, completion of an I/O operation, or a system error. Continuously checking for such events wastes CPU time. To handle these situations efficiently, the concept of interrupts is used. Interrupts allow the CPU to respond quickly to important events and improve overall system performance.
๐น Definition of Interrupt
An interrupt is a signal generated by hardware or software that temporarily halts the normal execution of a program and transfers control to a special routine called the Interrupt Service Routine (ISR). After the interrupt is serviced, the CPU resumes execution of the interrupted program.
๐น Need for Interrupts
Interrupts are required in a computer system for the following reasons:
- To improve CPU efficiency
- To avoid continuous polling of I/O devices
- To handle urgent and time-critical events
- To support multitasking and real-time processing
๐น Interrupt Structure (Working of Interrupt)
The working of an interrupt follows a fixed sequence of steps known as the interrupt structure:
- An interrupt request is generated by a device or program
- CPU completes the current instruction
- CPU saves the current state (program counter, registers)
- Control is transferred to the Interrupt Service Routine (ISR)
- ISR performs the required operation
- CPU restores the saved state
- Execution of the interrupted program resumes
This mechanism ensures that the main program is not lost and continues correctly after servicing the interrupt.
๐น Types of Interrupts
Interrupts are classified into several types based on their source and priority.
1๏ธโฃ Hardware Interrupt
Hardware interrupts are generated by external hardware devices.
Examples:
- Keyboard key press
- Mouse movement
- Printer completion signal
Characteristics:
- Generated outside the CPU
- Used for I/O device communication
- Usually asynchronous
2๏ธโฃ Software Interrupt
Software interrupts are generated by programs using special instructions.
Examples:
- System calls
- Division by zero error
- Program exceptions
Characteristics:
- Generated internally
- Used for operating system services
3๏ธโฃ Maskable Interrupt
A maskable interrupt can be enabled or disabled by the CPU using control instructions.
Example:
I/O device interrupt
Characteristics:
- Can be delayed
- Lower priority
- Used when CPU is busy
4๏ธโฃ Non-Maskable Interrupt (NMI)
A non-maskable interrupt cannot be ignored or disabled by the CPU.
Example:
- Power failure
- Hardware failure
Characteristics:
- Highest priority
- Used for critical situations
5๏ธโฃ Vectored Interrupt
In a vectored interrupt, the address of the ISR is predefined and fixed.
Advantage:
- Faster response time
6๏ธโฃ Non-Vectored Interrupt
In a non-vectored interrupt, the ISR address is supplied externally.
๐น Example of Interrupt Operation
When a user presses a key on the keyboard:
- Keyboard generates a hardware interrupt
- CPU pauses the current task
- Keyboard ISR reads the key value
- CPU resumes the previous program
๐น Advantages of Interrupts
- Efficient use of CPU time
- Faster response to external events
- Better multitasking
- Reduced waiting time
๐น Disadvantages of Interrupts
- Complex hardware design
- Overhead of context switching
- Difficult to debug
๐น Applications of Interrupts
- Operating systems
- Real-time systems
- Embedded systems
- I/O handling
๐น Conclusion
Interrupts are an essential feature of modern computer systems that allow the CPU to respond efficiently to internal and external events. By temporarily suspending program execution and servicing urgent requests, interrupts improve system performance, responsiveness, and multitasking capability. Understanding interrupts is crucial for studying the logical organization and functioning of computers.
