CHAPTER 3: HARDWARE AND COMPUTER COMPONENTS 3.1 COMPUTERS AND THEIR COMPONENTS 3.1.1 General-Purpose Computer System A general-purpose computer system comprises: Processor (CPU):  Executes instructions Memory:  Stores data and instructions Input/Output (I/O):  Interfaces with external world 3.1.2 Essential Features of a Computer Input: Takes in data from the outside world Devices: keyboard, mouse, scanner, microphone Output: Displays data for human understanding Devices: monitor, printer, speaker Primary Storage (Memory): Main memory storing critical program instructions and data RAM (Random Access Memory) Volatile (loses data when power off) Secondary Storage: Non-volatile storage for data Examples: hard disk, SSD, USB flash drive Removable Secondary Storage: File backup and archives Portable transfer of files 3.1.3 Embedded Systems Definition: Miniature computer systems (microprocessors) that are often part of a larger system. Characteristics: Perform few specific functions Not general-purpose computers No moving parts (more reliable) Advantages: Reliable (no moving parts) Require less power Cheap to mass-produce Disadvantages: Difficult to program (no interface) Expensive expert help needed for repair 3.1.4 Hardware Device Operations Laser Printer: Laser beam and rotating mirrors draw image on photosensitive drum Image converted to electric charge Charged toner attracts to image Electrostatic-charged paper rolls against drum Charge pulls toner onto paper Heat in fuser fuses toner to paper 3D Printer: Starts with saved digital file (blueprint) Object built by adding layers of material (polymer resin) Object cured (hardened by UV light) Microphone: Sound waves enter and cause diaphragm vibrations Vibrations cause coil to move past magnetic core Electrical current generated Current digitized Speaker: Takes electrical signals Voice coil generates electromagnetic field Change in audio signal changes current direction Electromagnet attracted/repelled to permanent magnet Diaphragm vibrates, creating sound waves Magnetic Hard Disk: Platters covered with magnetizable material Mounted on central spindle, rotated at high speed Surface divided into concentric tracks & sectors Data encoded as magnetic patterns Read/write heads access data Solid State (Flash) Memory: Uses NAND-based flash memory Grid of columns & rows with 2 transistors at each intersection Floating gate stores electrons (represents 0 or 1) Control gate controls charge flow Optical Disc Reader/Writer: Disc surface has reflective metal layer Spun at high speed Laser beam reads/writes Tracks have amorphous and crystalline states Different states encode bit patterns Touchscreen: Type Description Resistive Two charged plates; pressure causes contact Capacitive Materials that store electric charge; touch transfers charge 3.1.5 Memory Types RAM vs ROM: Feature RAM ROM Volatility Volatile (loses data when power off) Non-volatile Read/Write Can be read and written Can only be read Use Stores currently executing program Stores OS kernel, boot-up instructions Static RAM vs Dynamic RAM: Feature SRAM DRAM Refresh Doesn't need to refresh Must be refreshed Speed Faster access time Slower access time Power Uses less power Needs higher power Cost More expensive (complex circuitry) Less expensive Structure Each bit stored in flip-flop Each bit stored as charge in capacitor Density Lower data density Higher data density Use Cache memory Main memory PROM vs EPROM vs EEPROM: Type Description Erasure Method PROM Programmable once after creation Cannot be erased EPROM Can be reprogrammed UV light exposure EEPROM Can be reprogrammed Electrical signal 3.1.6 Monitoring and Control Systems Monitoring System: Monitors state external to computer No changes made to environment No feedback required Control System: Regulates behaviour of other devices/systems Event-driven:  Responds to specific events Time-driven:  Takes action at specific times Components: Sensor:  Measures analogue property, transmits to processing unit Actuator:  Switches on/off heavy appliances (heater, fan) ADC:  Converts analogue signals to digital Transmission cable:  Transfers signals Feedback Systems: Output affects input of sensors Ensures system operates within criteria Enables automatic adjustment of conditions 3.2 LOGIC GATES AND LOGIC CIRCUITS 3.2.1 Basic Logic Gates AND Gate: Output is HIGH only if ALL inputs are HIGH Symbol: A · B or A AND B A B Output 0 0 0 0 1 0 1 0 0 1 1 1 OR Gate: Output is HIGH if ANY input is HIGH Symbol: A + B or A OR B A B Output 0 0 0 0 1 1 1 0 1 1 1 1 NOT Gate (Inverter): Output is opposite of input Symbol: A or NOT A A Output 0 1 1 0 3.2.2 NAND and NOR Gates NAND Gate: Opposite of AND (NOT-AND) Symbol: A · B A B Output 0 0 1 0 1 1 1 0 1 1 1 0 NOR Gate: Opposite of OR (NOT-OR) Symbol: A + B A B Output 0 0 1 0 1 0 1 0 0 1 1 0 3.2.3 XOR Gate XOR (Exclusive OR): Output is HIGH if inputs are DIFFERENT Symbol: A ⊕ B A B Output 0 0 0 0 1 1 1 0 1 1 1 0 3.2.4 Constructing Circuits from Truth Tables Process: Identify required output for each input combination Identify the logic expression Design the circuit using appropriate gates Test with truth table