Digital Logic Design & Computer Organization – Unit 1 Comprehensive Notes
Computer Types
- Definition of a computer
- “Fast electronic calculating machine” that:
- Accepts digitised input (data)
- Processes it using an internally stored list of instructions (program)
- Produces output information
- Internal storage is called memory
- Major categories
- Personal Computer (PC)
- Desktop-sized processing & storage; common in homes, schools, offices
- Notebook / Laptop
- Compact, battery-powered, portable versions of PCs
- Workstation
- Desktop form-factor but higher-resolution I/O graphics; aimed at CAD/engineering design
- Enterprise System
- Medium–large-corporation servers; higher compute & storage than workstations; backbone of Internet services
- Super-computer
- Optimised for large-scale numerical tasks (e.g.
weather prediction)
Functional Units of a Computer
- Five mutually independent units
- Input Unit
- Memory Unit
- Arithmetic Logic Unit (ALU)
- Output Unit
- Control Unit
- Data pathway overview
Input⟶Memory/ALU (Processor)⟶Output
where every transfer is sequenced by the Control Unit
Detailed Description of Each Unit
- Input Unit
- Accepts source programs/high-level code or raw data
- Keyboard most common; others: joystick, trackball, mouse, scanner
- Converts each keystroke/event into its binary code before forwarding to Memory or Processor
- Memory Unit
- Stores both programs and data
- Two levels
- Primary/ Main Memory
- Semiconductor cells grouped into words; each word has an address
- Random Access Memory (RAM)
- Read/Write; uniform access time taccess
- Read-Only Memory (ROM)
- Non-volatile; stores firmware / OS bootstrap
- Cache
- Small, fast SRAM blocks co-located with CPU to hide main-memory latency
- Secondary Memory
- Magnetic: disks, tapes, floppies
- Optical: CD-ROM, DVD, etc.
- High capacity, lower cost, slower; for infrequently accessed data
- Arithmetic Logic Unit (ALU)
- Performs arithmetic (+, −, ×, ÷) & bit-wise logical ops
- Operands brought from Memory into high-speed registers
- Control unit sequences multi-step operations
- Output Unit
- Opposite of input; presents processed information to outside world
- Examples: monitor, printer, speakers
- Control Unit (CU)
- “Nerve centre” generating timing/control signals
- Coordinates data flow among I/O, ALU, registers, Memory
Basic Operational Concepts & Example Instruction Flow
- Stored-program concept
- Program resides in memory; CPU fetches, decodes, executes sequentially unless altered
- Example assembly
- Fetch instruction into IR
- Fetch operand from address LOCA → R1/MDR
- ALU adds to R0; result back to R0
- Split-load alternative
Load LOCA, R1 then Add R1, R0
- Key processor registers
- IR – current instruction
- PC – address of next instruction
- MAR – holds address for memory access
- MDR – data to/from memory
- R0…Rn−1 – general-purpose
Typical Instruction Cycle (12 steps)
- Program loaded (via I/P) to Memory
- PC initialised to first instruction
- PC→MAR; Read asserted
- After taccess, word appears in MDR
- MDR→IR (decode phase begins)
- Determine whether ALU or memory is needed
- For memory operand: address → MAR ; Read
- MDR operand → ALU input
- ALU performs operation
- If result to memory: result → MDR
- Destination address → MAR ; Write asserted
- PC=PC+1 (next instruction fetch)
Interrupts
- I/O device raises Interrupt Request when service needed
- CPU saves current state, vectors to Interrupt Service Routine (ISR)
- After ISR completion, previously saved state is restored so main program continues
- Enables concurrency & responsive I/O without busy-waiting
Bus Structures
- Bus = group of shared parallel lines used for data, address & control signals
- Single-Bus architecture
- Cheapest, flexible peripheral attachment
- Only one master transfer at a time → arbitration logic required
- Performance bottleneck mitigated by cache/buffer registers
- Multiple-Bus architecture
- Higher throughput but ↑ cost & complexity
Software Taxonomy
- System Software
- Operating System (e.g., Windows, Linux, macOS)
- Language Processors
- Assembler (ASM → Machine)
- Compiler (HLL → Machine, whole program)
- Interpreter (HLL → Machine, line-by-line)
- Device Drivers (bridge OS ↔ peripherals)
- BIOS / Firmware (bootstraps hardware; governs basic I/O)
- Application Software
- General-Purpose (e.g., MS-Excel, VLC, Photoshop)
- Specific-Purpose (Ticketing, Payroll, HMS, etc.)
- Utility Software
- Antivirus, Disk-defragmenter, Text editors, etc.
- Elapsed Time = wall-clock time to run a program; includes CPU, memory, I/O
- Processor (CPU) Time = time CPU spends executing instructions
\text{CPU Time} = #\text{Instructions} \times \text{Cycles per Instr} \times t_{cycle} - Balanced system design: optimise compiler, ISA, micro-architecture together
Multiprocessor vs. Multicomputer
- Multiprocessor (Shared-Memory)
- Multiple CPUs with global memory address space
- Parallel execution of threads/tasks; high complexity & ↑ cost
- Multicomputer (Message-Passing)
- Separate computers interconnected by network; each has private memory
- Communicate via explicit messages
Evolution of Computer Generations
- First (1940-56): Vacuum Tubes, magnetic drum, machine language, UNIVAC/ENIAC
- Second (1956-63): Transistors, magnetic-core memory, assembly & early HLL (COBOL, FORTRAN)
- Third (1964-71): Integrated Circuits, keyboards+monitors, OS with multiprogramming
- Fourth (1972-2010): Microprocessor (Intel 4004), personal computers, GUI, networks
- Fifth (2010-?): AI, parallel processing, quantum, nano-tech; goals: natural-language & self-learning machines
Data Representation – Fixed-Point Systems
- Need positive & negative numbers → three schemes
- Sign-Magnitude
- MSB is sign (0=+, 1=−); remaining n−1 bits magnitude
- Range: −(2n−1−1)to+(2n−1−1); dual representations of 0
- 1’s Complement
- Negative formed by bit-wise complement; still two zeros
- 2’s Complement
- Negative = 2n−∣value∣; unique 0; hardware-friendly
- Example (4 bits)
- +5=0101
- −5
- Sign-Mag 1101
- 1’s Comp 1010
- 2’s Comp 1011 (invert bits + add 1)
Binary Addition & Overflow
- Half-adder truth table:
- For inputs a,b,c<em>in produce sum,c</em>out (standard 8-row pattern)
- Ripple-carry addition processes from LSB→MSB propagating carries
- Overflow when result does not fit fixed bit-width
- Unsigned: carry out of MSB
- 2’s complement: overflow if carry into MSB = carry out of MSB
Character Representation (ASCII)
- 7-bit standard; e.g., 01000001<em>2=41</em>16=6510 represents ‘A’
- Lexicographic ordering maintained because codes are sequential, aiding sorting
Floating-Point Representation (IEEE 754)
- Normalised scientific form: (−1)S×(1.Mantissa)×2E−bias
- Single-Precision (32-bit)
- S 1 bit, E 8 bits (bias 127), M 23 bits
- Range ≈ ±10±38
- Double-Precision (64-bit)
- S 1 bit, E 11 bits (bias 1023), M 52 bits
- Range ≈ ±10±308
- Special cases: E=0 & M=0 ⇒ 0.0; overflow/underflow when exponent outside representable range
- Addition algorithm
- Align exponents
- Add/subtract mantissas
- Normalise & round (guard, round, sticky bits)
- Multiplication algorithm
- Add exponents minus bias
- Multiply mantissas
- Normalise, round, set sign S=S<em>1⊕S</em>2
Memory Organisation
- Memory = 2k addressable locations; each holds a word (or byte)
- Word length common: 16→64 bits; 1byte=8bits
- Example: 32-bit address space → 232 (≈4 Gi) locations
Number-Base Conversions
- Decimal ↔ Binary
- Integer: repeated divide-by-2; Fraction: repeated multiply-by-2
- Example 10.25<em>10=1010.01</em>2
- Decimal ↔ Octal (radix-8); Hex ↔ Binary (4-bit nibble mapping) etc.
Complements Review
- Radix (& Diminished) complements generalise to any base r
- r!′s complement=rn−N
- (r−1)’s complement = rn−1−N
- In binary, 2’s and 1’s complements realise these
- MSB denotes sign; remaining bits magnitude (Sign-Magnitude system)
- Digital hardware stores only bits; plus/minus represented via this MSB
Binary Codes
- Weighted Codes obey positional weights
- 8421 BCD: decimal digit ⇒ 4-bit pattern (0000–1001)
- Non-Weighted Codes
- Excess-3 (XS-3): BCD + 00112; self-complementing
- Gray Code: unit-distance; only one bit changes between successive numbers; used in rotary encoders
- BCD (Binary-Coded Decimal)
- Pros: human-friendly; Cons: wastes 6 invalid codes, arithmetic rules more complex
- Alphanumeric Codes
- ASCII (7-bit), EBCDIC (8-bit), Baudot (5-bit)
- Enable representation of letters, digits, punctuation for data exchange