REVISION 2 Central Processing Unit (CPU) It interprets and carries out basic instructions that operate a computer. CPUs contain processing units that decode and encode software instructions, perform arithmetic calculations and comparisons, make logical decision. CPU’s 3 Main Subsystem: Control Unit: contains circuitry that uses electrical signals to direct the entire computer system to carry out, or execute, stored program instructions Arithmetic Logic Unit (ALU): is a digital circuit that performs arithmetic and logical operations. Registers: are temporary storage areas for instructions or data. The Fetch Execute Cycle: Fetch Cycle a) Fetch the Instruction from Main Memory The CPU presents the value of the program counter on the address bus. The CPU then fetches the instruction from main memory via the data bus into the Instruction Register. b) Decode the Instruction The instruction decoder (ID) interprets and implements the instruction Execute Cycle a) Get Data from Main Memory Fetch required data from main memory to be processed and placed into registers. b) Execute the Instruction Control signals are initialized to process the data using ALU and write the result back to a register. c) Store Results The result generated by the operation is stored in the main memory, or sent to an output device. • ROM - Read-Only Memory is an integratedcircuit memory chip that contains configuration data. ROM is non-volatile, so data stored in ROM stays there even if computer is not running and powered off. • RAM - Random-access Memory provides space for your computer to read and write data to be accessed by the CPU. RAM is volatile, so data stored in RAM stays there only as long as the computer is running and powered on. • A serial port transmits one bit of data at a time and is used to connect slow-speed devices, such as mouse, keyboard, mode. • A parallel port connects devices that can transfer more than one bit at a time, such as a printer • A bus is a collection of wires through which data is transmitted from one part of a computer to another. It is used to transmit the data from one part of a computer to another and in order for multiple hardware components to communicate with one another, • The address bus (sometimes called the memory bus) transports memory addresses which the processor wants to access in order to read or write data. It is a unidirectional bus. • The data bus transfers instructions coming from or going to the processor. It is a bidirectional bus. • The control bus (or command bus) transports orders and synchronisation signals coming from the control unit and travelling to all other hardware components. It is a bidirectional bus, as it also transmits response signals from the hardware • Components of a personal computer - Summary • Computer Case – aluminium casing to store all components. • Motherboard • Central Processor Unit (CPU) • Power supply • Memory RAM • Hard Disk • VGA and Sound Card • Input / Output Devices: * – Keyboard/Mouse, Webcam, Monitor, Printer, Scanner – Removable Media Drives: *CD/DVD/BlueRay Drive, USB drives, Floppy Disks. • Software • Components of a motherboard - Summary – – – – – – – – – – – – CPU Socket (for CPU to be inserted) Chipset Integrated peripherals Peripherals card slots (AGP, PCI, PCI-e) Memory Ram DIMM slots IDE/SATA Hard disk interface slots USB slots PS/2 ports for keyboard, mouse. Various electronic resistors, capacitors. EEPROM chip that holds the BIOS Setup* CMOS Battery ATX Power Connectors • The motherboard consists of multiple BUS types and split into two controllers, namely North bridge and South bridge. • The North Bridge controller manages the Internal buses connecting to CPU, Graphic card, Hard disks, Memory RAM and PCI-e slots. • The South Bridge controller manages the External bus that support ports for other external peripherals such as USB ports, Firewire ports, eSATA, SCSI, PCI slots • Software is generally divided into Systems software and Applications software. • System Software is designed to operate the computer hardware and to provide and maintain a platform for running application software e.g. BIOS, Device driver, Operating system, Utility software, Compilers, Interpreters, Assemblers, Debugger • Applications software are programs designed for an end user and interacts with systems software. It is unable to run without the operating system and system utilities. e.g. Word processors, Database systems, Spreadsheet programs, Multimedia Software, Presentation Software Enterprise software , Information worker software ,Content access software , Educational software, Simulation software , Media development software Storage devices are normally categorised into: • Primary Storage* e.g. Memory RAM, cache, registers Primary storage holds instructions and data for rapid and direct access by the computer's central processing unit. Primary storage is volatile and loses the data when the device is powered down • Secondary Storage* e.g. Magnetic Hard disks, floppy disks, Secondary storage differs from primary storage in that it is not directly accessible by the CPU. Secondary storage is non-volatile and does not lose the data when the device is powered down • Tertiary Storage* Tape Drives, CD library changer. Its main use is for storing data at a very large-scale. Tertiary storage devices require a database to organize the data that are stored in them • Removable (offline) storage Offline or disconnected storage is not directly connected to the computer and is used as a transfer medium only. Offline storage devices are remotely located and accessed. E.g. USB flash drive, CDs. Hard disk Partitioning • In order for a hard disk to be used it must be divided into multiple logical storage units referred to as partitions • Primary Partition: is the active (bootable) partition that is used to start an operating system • Extended Partition: is a partition that can be sub-divided into logical drives. • Logical Drives: A logical drive is created within an extended partition. Multiple logical drives can be created from the extended partition • File systems are the structures behind how your computer stores and organizes data. The file system manages a folder/directory structure, which provides an index to the files, and it defines the syntax used to access. • FAT32 and NTFS are Windows file systems, and HFS is used on Macs. Linux uses ext2, ext3 and FAT32. Unix systems use UFS, ext2, ext3 and ZFS • After partitioning, the hard disk will be formatted to follow the File System according to the OS installed. RAID stands for Redundant Array of Independent Disks, and with at least two or more hard disk drives, you can setup them up as a RAID array and can be combined into one logical unit, where data is distributed across multiple drives. RAID 0: • (also known as a stripe set or striped volume) splits data evenly across two or more disks and offers the best performance. However there is no fault tolerance. In a RAID 0 array, if you have 2 disks and 1 fails, the entire array fails. RAID 1: • creates an exact duplicated copy (or mirror) of a set of data on two or more disks. This is useful when read performance or reliability is more important than data storage capacity. RAID 5: • Block-level striping with parity data distributed across all member disks. But requires at least three and usually five disks for the array. It provides data redundancy and increases speed Basic input/output system (BIOS), also known as the System BIOS The BIOS software is built into the PC on a non-volatile ROM and is the first code run by a PC when powered on. In the BIOS User Interface, a user can: • configure hardware • set the system clock • enable or disable system components • select which devices are eligible to be a potential boot device • set various password prompts, such as a password for securing access to the BIOS UI functions itself and preventing malicious users from booting the system from unauthorized peripheral devices. Power On Self Test (POST) • POST includes instructions to perform internal tests, as designed by the device manufacturer. • The Instructions are stored in ROM memory, and performed every time the computer system is started. • It initialize and test system components such as the CPU, RAM and other hardware • IRQ stands for "Interrupt Request." PCs use interrupt requests to manage various hardware operations. • IRQs are hardware lines over which devices can send interrupt signals to the microprocessor • DMA (Direct memory access) channels are system pathways used by many devices to transfer information directly to and from memory. • DMA is a system which allows an adapter to transfer data to RAM without CPU involvement. • Input/Output ports are memory addresses used by the processor for direct communication with a device that has sent an interrupt signal to the processor. 8085 Pin Diagram • X1, X2 - (Pin 1 and 2 - Input) A Crystal Oscillator is connected across the pins X1 and X2. By Dividing the crystal oscillator frequency by 2, the clock is generated with the equal ON and OFF pulses. • AD0 - 7 (Pin 12 to 19 - Input/Output 3state) It holds the lower order 8-bit address that is used to identify a memory address location and read/write data from/into there. It also transfers data through it. Data and address lines are multiplexed (the pins shares 2 different functions) • RD (Pin 32 - Output 3state) READ; The signal on low indicates the peripheral that the processor is performing RAM memory or I/O read operations. • WR (Pin 31 - Output 3state) WRITE; indicates the data on the Data Bus is to be written into the selected memory or 1/0 location. Data is set up at the trailing edge of WR. 3stated during Hold and Halt modes. • READY (Pin 35 - Input) If Ready is high during a read or write cycle, it indicates that the memory or peripheral is ready to send or receive data. If Ready is low, the CPU will wait for Ready to go high before completing the read or write cycle. • RESET IN (Pin 36 - Input) Reset sets the Program Counter to zero and resets the Interrupt Enable and HLDA flipflops. None of the other flags or registers (except the instruction register) are affected The CPU is held in the reset condition as long as Reset is applied. • RESET OUT (Pin 3 - Output) Indicates CPlJ is being reset. Can be used as a system RESET. The signal is synchronized to the processor clock. • Vcc +5 volt supply. • Vss (Pin 20 GND or GROUND) For Ground Reference Types of Microprocessor Architectures Complex Instruction Set Computer (CISC) Where most of the work is to done by Microprocessor itself. The Line of Codes or long, complex instructions are performed by the processor and put a high work load on the processor. Primarily used by Intel in early 1990s computers and still exist in current modern Intel processors. Reduced Instruction Set Computer (RISC) Where most of the work is to perform by the software itself, the load on a processor is very low. Smaller, highly-optimized set of instructions are performed at a time, so that it can operate at a higher speed (perform more millions of instructions per second, or MIPS) The RISC architecture was first used by Apple Corporation's Macintosh computers, IBM and Sun Microsystems. Very Long Instruction Word (VLIW) In this architecture a compiler breaks instruction into basic operations to be performed by processor. VLIW is the next step of RISC. Instructions are moved from the hardware to the software so it reduces the hardware cost. Superscalar Processors Perform more than one instruction in each processing cycle. It uses caches, parallel processing and floating points. Few other are General Purpose Processor (GPP) Special Purpose Processor (SPP) Application-Specific Integrated Circuit (ASIC) Application-Specific Instruction-set Processor (ASIP) Digital Signal Processor (DSP An instruction is a binary pattern designed inside a microprocessor to perform a specific function. The entire group of instructions that a microprocessor supports is called Instruction Set. The method of specifying the data to be operated by the instruction is called Addressing Immediate Addressing This is the simplest form of addressing. Here, the operand is given in the instruction itself. In immediate addressing mode, the data is specified in the instruction itself. The data will be a part of the program instruction. Example: ADD B, 3A - Add the data 3A in the instruction to B register Direct Addressing In direct addressing mode, effective address of the operand is given in the address field of the instruction. It requires one memory reference to read the operand from the given location and provides only a limited address space. Example : LDA 20FF, where 20FF is the address of operand. Register Direct Addressing Register addressing mode is similar to direct addressing. In register addressing mode, the instruction specifies the name of the register in which the data is available. Example: MOV A, B - Move the content of B register to A register Implicit Addressing: In implicit addressing mode, the instruction itself specifies the data to be operated. Example: CMA - Complement the content of accumulator