Computer Architecture and Digital Logic Vocabulary
Combinational Logic Circuits and Programmable Logic Devices
Decoders:
Definition: A decoder is a combinational circuit that converts binary information from input lines to a maximum of unique output lines.
Structure: An -input to -output decoder expands an -bit binary code into up to minterms.
3-to-8 Decoder Example:
Inputs: lines ( or ).
Outputs: lines ( through ).
Operation: For each input combination, exactly one output line is set to (active high), corresponding to a unique minterm ( to ).
Truth table mappings for active outputs:
Applications:
Binary-to-octal decoding
Code conversion
Memory address decoding
Seven-segment display driving
Generation of Boolean minterms for combinational functions
Encoders:
Definition: An encoder performs the exact inverse operation of a decoder. It accepts one active input line among many and converts it into an -bit output binary code.
8-to-3 Encoder Example:
Inputs: lines ( to ).
Outputs: lines ().
Operation: Assumes only one input line is active at any given time. If input , the output generates the binary value .
Priority Encoders:
Definition: A priority encoder resolves the limitation of standard encoders where multiple inputs may be asserted simultaneously. It guarantees that if two or more inputs are active concurrently, the input with the highest priority is selected.
Operation Rules:
Highest-numbered input line is typically assigned the highest priority.
An additional valid output flag () indicates whether at least one input line is active () or no inputs are active ().
Boolean Equations for Priority Encoder Outputs:
Output
Output
Valid output flag
Multiplexers (MUX):
Definition: A multiplexer (or data selector) is a combinational circuit that receives binary information from input data lines and directs one selected input line to a single output line based on selection variables.
4-to-1 Multiplexer:
Data inputs:
Selection lines:
Output:

Boolean Logic Expression:
MUX as a Universal Function Generator:
Any Boolean function of variables can be implemented using a multiplexer with selection lines.
Boolean variables are assigned to the selection inputs, while data inputs are connected to , , a remaining variable, or its complement.
Applications of Multiplexers:
Data selection and routing
Communication channels and time-division multiplexing
Parallel-to-serial data conversion
Arbitrary Boolean function implementation
Processor bus and data path selection
Read-Only Memory (ROM):
Definition: ROM is a non-volatile semiconductor memory device pre-programmed with permanent binary data. Information remains stored indefinitely even when power is removed.
ROM Architecture:
Inputs: address input lines.
Outputs: data output lines.
Size: Specified as , containing addressable words of bits each.
Internal Components: A decoder of size generating all minterms, connected to OR gates forming a programmable output array.
Combinational Function Implementation:
Since an decoder generates all minterms of input variables, connecting selected decoder outputs to OR gates realizes any set of Boolean functions.
Example: Implementing .
Use as 3 address lines ( addresses).
Program the ROM memory array to output at memory addresses () and at all other addresses.
Summary Formulas for Digital Logic Design:
Full Adder Sum equation:
Carry Propagation equation:
Carry Generate:
Carry Propagate:
2's Complement Subtraction:
BCD Addition Correction factor: add binary () when sum exceeds or generates a output carry.
Comparator Bit Equality:
Decoder Outputs count:
MUX Inputs count:
ROM Addresses count:
Basic Computer Organization and Design
Instruction Codes:
Definition: An instruction code is a group of bits that instructs the computer to perform a specific operation, data transfer, or control action. Program instructions and data reside in common memory storage.
Execution Process: The CPU fetches an instruction from memory into the Instruction Register (IR), where the control unit decodes the operation code and issues the microoperations required for execution.
Instruction Code Fields:
Opcode (Operation Code): Group of bits defining the specific arithmetic, logical, or control operation (e.g., ADD, SUB, LOAD, STORE, AND, OR).
Address Field: Bits specifying the memory location or CPU register containing the operand.
Mode Bit (): Direct/Indirect addressing mode bit.
Basic Computer 16-Bit Instruction Format:

Bit ( bit): Indirect address bit ().
: Direct address (address field points directly to operand).
: Indirect address (address field points to a memory location holding the effective address of the operand).
Bits ( bits): Opcode field (supports operations).
Bits ( bits): Address field (addresses up to memory words).
Total bit length: .
Instruction Categories:
Memory-Reference Instructions ( through ).
Register-Reference Instructions ( with ).
Input-Output Instructions ( with ).
Computer Registers:
AR (Address Register): \text{ bits}. Holds memory address for read/write operations.
PC (Program Counter): \text{ bits}. Holds address of the next instruction to fetch from memory; automatically incremented after instruction fetch.
DR (Data Register): \text{ bits}. Holds data read from or written to memory.
AC (Accumulator): \text{ bits}. General-purpose processor register used for performing arithmetic and logical operations and storing intermediate results.
IR (Instruction Register): \text{ bits}. Holds opcode and operand address of the current instruction during decoding and execution.
TR (Temporary Register): \text{ bits}. Stores temporary internal data during complex execution cycles.
INPR (Input Register): \text{ bits}. Holds an 8-bit input character transferred from an input device.
OUTR (Output Register): \text{ bits}. Holds an 8-bit output character transferred to an output device.
SC (Sequence Counter): Controls execution timing by generating sequence timing signals ().
Computer Instruction Set Architecture:
Memory-Reference Instructions:
AND: (Bitwise Logical AND)
ADD: (Binary Addition with Carry)
LDA: (Load Memory Word to Accumulator)
STA: (Store Accumulator to Memory)
BUN: (Branch Unconditionally)
BSA: (Branch and Save Return Address)
ISZ: ; if then (Increment and Skip if Zero)
Register-Reference Instructions (Executed when and ):
CLA: (Clear Accumulator)
CLE: (Clear Extended Bit E)
CMA: (Complement Accumulator / 1's Complement)
CME: (Complement Extended Bit E)
CIR: Circulate right and
CIL: Circulate left and
INC: (Increment Accumulator)
SPA: Skip next instruction if
SNA: Skip next instruction if
SZA: Skip next instruction if
SZE: Skip next instruction if
HLT: (Halt Computer Processing)
Input-Output Instructions (Executed when and ):
INP: (Input Character)
OUT: (Output Character)
SKI: Skip if Input Flag
SKO: Skip if Output Flag
ION: (Interrupt Enable On)
IOF: (Interrupt Enable Off / Disable)
Input-Output Organization and Interrupts:
I/O Communication: Peripherals operate independently and asynchronously from CPU speeds. Communication requires I/O interface logic, temporary buffering registers (INPR, OUTR), and status flags (FGI, FGO).
Input Operation Sequence:
External device places character data in INPR.
Input flag is set to
CPU checks flag.
CPU transfers character from INPR into .
Input flag is cleared to
Output Operation Sequence:
CPU transfers output character from into OUTR.
Output flag is set to
External device receives character from OUTR.
Output flag is set back to when device is ready for new data.
Interrupt Mechanisms:
Purpose: Eliminates programmed I/O status flag polling by allowing peripherals to signal the CPU only when service is needed, enabling continuous CPU instruction execution.
Interrupt Cycle Steps:
CPU completes current instruction execution cycle.
CPU inspects interrupt request line condition.
If interrupt flag is enabled () and flag is active ( or ), interrupt sequence triggers.
Current program context and Program Counter return address are saved (stored at memory location ).
CPU branches to Interrupt Service Routine (ISR) by loading
Interrupt Service Routine executes to process device request.
CPU executes indirect branch to return to original program execution point.
Central Processing Unit Architecture
CPU Structure:
Major Components:
Register Set: Stores operands, intermediate results, addresses, and status information.
Arithmetic Logic Unit (ALU): Performs execution of arithmetic, logic, and shift operations.
Control Unit: Decodes instructions, manages internal control pathways, and issues timing sequence signals.
Common CPU Organizations:
Single Accumulator Organization
General Register Organization
Stack-Based Organization
General Register Organization:
Architecture: Registers are connected through internal buses multiplexed into the inputs of an ALU. Operations select two source registers, pass them through ALU logic, and route results back to a target register.
Operation Walkthrough ():
Control logic selects register via Bus A multiplexer (MUX A).
Control logic selects register via Bus B multiplexer (MUX B).
Arithmetic Logic Unit performs ADD operation on inputs A and B.
Destination decoder selects register
Calculated sum is loaded into register
Control Word Format:

SELA Field: \text{ bits} (selects Bus A source register).
SELB Field: \text{ bits} (selects Bus B source register).
SELD Field: \text{ bits} (selects destination register).
OPR Field: \text{ bits} (selects specific ALU operation).
Total Control Word Length: .
Stack Organization:
Definition: A stack is a Last-In, First-Out (LIFO) memory structure where data elements are added and removed from a single top location.
Stack Pointer (SP): A register holding the memory or register address of the current top element of the stack.
Fundamental Operations:
PUSH: Inserts an item onto the stack.
Register Stack PUSH Microoperations:
POP: Removes an item from top of stack.
Register Stack POP Microoperations:
Stack Types:
Register Stack: Implemented using a dedicated set of internal CPU registers with fixed maximum capacity.
Memory Stack: Allocated as a dedicated region inside main memory; variable capacity controlled by Stack Pointer.
Reverse Polish Notation (RPN / Postfix):
Eliminates requirement for evaluation parentheses in algebraic expressions.
Infix:
Postfix / RPN:
Stack CPU execution: Operands are pushed onto stack sequentially; arithmetic operations pop top operands, compute result, and push output back to stack top.
Instruction Formats:
Fields: Opcode field, Address field(s), and Addressing Mode field.
Three-Address Instructions:
Format:
ADD R1, R2, R3Operation:
Characteristic: Short program length, requiring more bits per instruction.
Two-Address Instructions:
Format:
ADD R1, R2Operation:
Characteristic: One register serves as both source operand and destination location.
One-Address Instructions:
Format:
LOAD A,ADD BOperation: , then
Characteristic: Implicating a single Accumulator (AC) register for all arithmetic/logic operations.
Zero-Address Instructions:
Format:
PUSH A,PUSH B,ADDOperation: Operands implicitly popped from and pushed onto top of stack.
Memory Hierarchy and Organization
Memory Hierarchy:
Rationale: Memory systems balance physical trade-offs where higher speed leads to increased cost per bit and smaller capacities, whereas low-cost, high-capacity memory suffers from slower access rates.
Levels of Hierarchy (Fastest/Smallest to Slowest/Largest):
CPU Registers: Located inside the CPU core; sub-nanosecond access time; extremely limited capacity.
Cache Memory: High-speed SRAM located close to CPU; holds active instructions and data to minimize CPU delay.
Main Memory (RAM): Semiconductor memory communicating directly with CPU via system memory buses.
Auxiliary Memory: Secondary non-volatile magnetic or optical storage devices (e.g., HDDs, SSDs, magnetic tapes) providing mass storage.
Principle of Locality of Reference:
Temporal Locality: Programs tend to execute recently accessed data or instruction memory locations repeatedly in short time spans.
Spatial Locality: Programs tend to access memory locations physically adjacent to recently referenced addresses.
Main Memory:
Definition: Primary memory unit directly addressed by the CPU during instruction execution cycles.
Random Access Memory (RAM):
Operates read and write functions.
Volatile storage (loses stored content when system power turns off).
SRAM (Static RAM): Constructed using internal flip-flop latches; does not require refresh cycles; provides higher speed; higher cost and lower density; used in Cache memory.
DRAM (Dynamic RAM): Stores bits as electrical charges inside MOS capacitors; requires periodic refresh; high storage density; lower cost per bit; used for main memory.
Read-Only Memory (ROM):
Non-volatile (retains stored data when system power turns off).
Primarily read operations; used for pre-stored system software, firmware bootstrap loaders, and static tables.
RAM vs. ROM Comparison:

Memory Capacity Calculation:
An -bit address bus yields addressable memory locations.
Example: An address bus with address lines produces: