Computer Architecture Outline PDF
Document Details
Uploaded by DarlingOlive
Tags
Summary
This document outlines the architecture of computer's central processing unit (CPU). It details the functions of the arithmetic logic unit (ALU) and control unit (CU), along with the various registers within the CPU. It also explains primary memory (RAM and ROM), buses, and cache memory.
Full Transcript
Computer Architecture Outline the architecture of the central processing unit (CPU) and the functions of the arithmetic logic unit (ALU) and the control unit (CU) and the registers within the CPU Block diagram Main components: CPU contrains CU , ALU, and Registers (MAR, MDR) RAM / ROM Buses (Addres...
Computer Architecture Outline the architecture of the central processing unit (CPU) and the functions of the arithmetic logic unit (ALU) and the control unit (CU) and the registers within the CPU Block diagram Main components: CPU contrains CU , ALU, and Registers (MAR, MDR) RAM / ROM Buses (Address, Data, Control) Central Processing Unit (CPU) · The CPU carries out the instructions for input and output processes and arithmetic and logical operations. · A CPU is an integrated circuit printed on a silicon chip called a microprocessor. · The CPU consists of the arithmetic and logic unit (ALU), the control unit (CU), and the memory registers. Arithmetic Logic Unit (ALU) · Adds numbers together (i.e. it does arithmetic). · Allows for logic decisions to be made (e.g. If the value is negative then). · Acts as the gateway (input and output pass through) between the processor and the other parts of the computer system. · Performs the following operations: ADD, AND, OR, NOT · Contains registers for storing temporary data (i.e. Accumulator) Control Unit (CU) · Controls communication between CPU and memory · Decides which instruction to carry out next and then go and get it. · Deciphers the instruction, in other words it has to work out what needs to be done to carry the instruction out. · Tells other parts of the processor what they should do so that the instruction will be carried out. Registers · Registers are very small capacity, extremely fast blocks of volatile memory within the CPU. · Data and instructions to be used by the CPU are stored here. Memory Address Register (MAR) · Contains the next instruction address to be fetched from cache/RAM; · The MAR is connected to the address bus; · The MAR is how the CPU communicates with the address bus; · The MAR can hold either an instruction address or a data address; Memory Data Register (MDR) · Contains the contents of the next instruction and address that has just been fetched from volatile memory; · The MDR is connected to the data bus. · Data can go in both to and from memory (bi-directional), · The MDR can load its data from one of the CPU registers (for storing data.) Buses · The Central Processing Unit (CPU) contains buses for transmitting data. · They are the physical wires that pass electronic signals to and from the CPU. · The control bus will transmit instructions from the CU to registers and the ALU. · The address bus will transmit information about where instructions and data are located · The data bus will transmit the data from and too the appropriate address (bi-directional). Describe primary memory Random Access Memory (RAM) · Volatile so when the power is switched off all memory disappears; · Accessed directly by the CPU · Can be written to and read from quickly; · Much faster than secondary memory (e.g. SSD or HDD); · Dynamic Ram (DRAM) or Static RAM (SRAM); · RAM acts as temporary storage and working space for the operating system and its applications; · RAM takes the form of integrated circuits attached to the motherboard in slots. Read Only Memory (ROM) · Non-volatile so when the power is switched off the memory remains. · Read Only Memory (ROM) stores instructions and data that don’t change. · Typically the ROM in a computer contains instructions that control how a computer starts up, reads input, and writes output (BIOS) · The BIOS (basic input output system) contains the instructions necessary to boot the computer. Explain the use of cache memory · Small, very fast (faster than RAM), memory that stores the data from frequently used main memory addresses; · It lies between the CPU and main memory (built into CPU); · Cache holds frequently used data/instructions; · More expensive than RAM; · Cache memory is static RAM and this memory doesn't need to be constantly refreshed; · Used by the CPU to reduce average memory access times. (i.e. saves times and speeds up processing.) How does it work? · Request made from CPU. · Cache is checked for the data. · If found - data returned from cache (cache hit). · Else (cache miss) - data returned from RAM (main memory). · Too many missed checks slow retrieval down because Cache and then RAM is checked. Explain the machine instruction cycle. Fetch · The program counter holds the address of the next instruction to be carried out. · The address is copied to the memory address register (MAR) · The contents of the address in the MAR are copied to the memory data register (MDR) · The contents of the MDR are copied to the instruction register (IR) · The PC is incremented Decode · The instruction in the instruction register (IR) gets decoded. · The control unit interprets the operation code so that CPU knows what to do. Execute · Code for the instruction is executed by the ALU. · The address part of the instruction is copied from CIR to MAR · The data found in the address in MAR is copied to MDR · The data is used (If arithmetic is to be carried out then the contents of MDR are sent to the accumulator; if a jump instruction is to be carried out then the contents of the MDR are copied to the PC) Store · Results of instruction written to memory. Computer Memory Identify the need for persistent storage Persistent storage (retains data after power is removed) Solid state drives (SSD) · Solid state media / direct access · Medium capacity storage (e.g. 256Gb), faster than HDD Hard disk drive (HDD) · Magnetic media / direct access · Large capacity storage (e.g. 1 TB), slow relative to RAM USB Memory Stick · Solid state media / direct access. · Medium capacity storage (e.g. 128 Gb). Digital Versatile Disk (DVD) · Optical media / 4.7 GB single layer. · Blu-ray – optical media / 25 GB single layer Magnetic tape · Magnetic media / sequential access/ (1TB per tape) · Portable and used to back up servers with tapes moved offsite or placed in a fireproof safe. Storage in Bytes · 1 kilobyte (KB) is 1024 bytes (210) · 1 megabyte (MB) is 1,024 KB (220) · 1 gigabyte (GB) is 1,024 MB (230) · 1 terabyte (TB) is 1,024 GB (240) · 1 petabyte (PB) is 1024 TB (250) · 1 exabyte (EB) is 1024 PB (260) Operating systems Describe the main functions of an operating system. The role of the Operating System (system software) An operating system (system software) is a suite of programs designed to run in the background on a computer system and control the hardware, The O.S. provides an environment in which application software can be installed and executed. It provides the interface between the user and the hardware. The operating system is stored on an SSD/HDD and is loaded into RAM when the computer is turned on. This process is called bootstrapping. O.S. functions include memory management, file management, scheduling, and provides a number of utility programs (e.g. disk defragmentation, drive formatting, auto-backup, print spooling, and many others) Memory Management This O.S. function places data in random access memory so that it can be accessed by the CPU. It performs the following tasks: allocates primary memory to store processes/programs and data protects processes from each other (so that different processes don't get mixed up) reallocates memory when necessary (reclaims and allocates to other processes) protects operating system (keeps it separate from other applications) handles virtual memory (paging and segmenting) enables certain processes in memory to be shared rather than duplicated File Management This O.S. manages the loading and saving of files to secondary storage. The location of files is set out logically through the use of folders/directories. For example: C:\Documents\Mathematics\file1.txt. The physical location of where file1.txt is stored is unknown to the user and handled by the operating system. Logical locations are converted into physical locations and stored so that files can be retrieved. This is a form of abstraction (data hiding) that is carried out by the operating system. File data When a file is saved the following data is also stored: File Name with File Extension e.g. File1.txt (the extension lets the operating system know the type of file and which programs can be used to open it) Owner (who created and modified the file) File Date (date the file was created, the date the file was last modified) File size (the number of bytes that is used by this file) Scheduling The scheduling function in the operating system is used to determine which task to carry out next. Thus, the purpose of scheduling is to: optimize the use of the processor so that it is not idle for very long make efficient use of resources (e.g. secondary storage, printers, etc..) maximize the number of tasks to be completed or to maximize the number of users that are supported (only in a multiuser operating system). ensure that there is no apparent delay for users (reasonable response time) There are several types of scheduling but two of the most common are round robin, shortest job first: Round robin (equal time-slicing) In this system, each user allocated an equal time slice in turn (time slice are fractions of a second). Start at job1, move to job2, then job3, and eventually back to job1 again. If not completed the job moves to the back of the queue. Priorities can be used to determine the order of processing. Shortest job first In this scheduling system the shortest job is completed first. Thus more jobs are completed using this approach. However, while the queue appears short, long jobs may never get any processor time Outline the use of a range of application software. Application software should include word processors, spreadsheets, database management systems, email, web browsers, computer-aided design (CAD) and graphic processing software. Identify common features of general purpose applications. Generic - Windows, Icons, Menus, Pointers (WIMP), toolbars, dialog boxes Spreadsheets - features include formulae, chart creation. Word Processors - features include spell and grammar checker, text formatting, mail merge. Web browsers - features include multiple tabs/windows, browser history, cookies, javascript translator. CAD (Computer Aided Design) - 3D rendering e.g. lighting and shading applied; library of shapes to add to your designs. Email - features include spam folder, creating folders for specific people, rules to direct emails. Integrated Development Environment (IDE) - features include command term pop up, syntax analysis (underline typos), compile code. Binary Representation Define the terms: bit, byte, binary, denary/decimal, hexadecimal. Bit A unit of data expressed as either a 0 or 1 (A binary digit). Byte A byte are 8-bits taken together. The following are a combination of bytes: 1 kilobyte (KB) is 1024 bytes (210) 1 megabyte (MB) is 1,024 KB (220) 1 gigabyte (GB) is 1,024 MB (230) 1 terabyte (TB) is 1,024 GB (240) 1 petabyte (PB) is 1024 TB (250) 1 exabyte (EB) is 1024 PB (260) Binary The base 2 number system that recognizes the values 0 and 1 only. Computers process and store data in binary only because a transistor only has two states: on or off. Denary/Decimal The base 10 number system that uses the values 0 to 9 inclusively. Hexadecimal The base 16 number system that uses the values 0 to 9 inclusively and A, B, C, D, E, F to represent 10 to 15 respectively. Hexadecimal numbers are a convenient way of representing binary numbers because 4 bits = 1 hexadecimal number. It is easier to find errors and fix them using hexadecimal rather rather binary. For example, AAB1 is less complex compared to 1010101010110001. Outline the way in which data is represented in the computer. Character Sets A character is represented by a series of bits unique to that character. Common sets include ASCII and Unicode. ASCII and Unicode A standard set of keyboard characters that are represented using either an 8 bit (ASCII or EBCDIC) or 8/16/32 bit (Unicode) number. This will give ASCII 128 characters with the most significant bit being used for parity (to ensure it has been transmitted correctly) so it only uses 7 of the 8 bits Unicode offers significantly more characters than ASCII and can include Greek, Russian, Korea, and Latin characters as well as many others. Images Images are represented using pixels, with each pixel represented by a group of binary digits. The number of bits used to represent each pixel determines the quality and resolution of the image. Bit-mapped images are made up of a number of pixels. We can use 3 Bytes (24 bits) to represent the colour of each pixel. Full colour is 2563 or 16.7 million colours from 000000 (black) to FFFFFF (white). Each colour is made up of a combination of the three primary colours red, green and blue component (RGB). For example: A red pixel will have the following colour components: RED 1111 1111 (i.e. FF); GREEN 0000 0000 (i.e. 00); BLUE 0000 0000(i.e. 00) A simple 2x2 pixel image with the following colors: Each color component can have a value between 0 and 255. To represent these colors in binary, we can use 8 bits (1 byte) for each component. So the binary representation of the image would be: Pixel 1: 11111111 00000000 00000000 Pixel 2: 00000000 11111111 00000000 Pixel 3: 00000000 00000000 11111111 Pixel 4: 11111111 11111111 11111111 In this example, each pixel is represented by 24 bits (3 bytes) of data, and the entire image is represented by 96 bits (12 bytes) of data. Sound To determine the storage required for a 10-second sound clip sampled at 44100 Hz, we need to consider the following: The sampling rate (44100 Hz) indicates the number of samples taken per second. The duration of the clip (10 seconds) indicates the total number of samples required. The number of bits used to represent each sample determines the storage required. Assuming a standard stereo audio format with 16 bits per sample, the calculation is as follows: 44100 samples per second x 2 channels (for stereo) = 88200 samples per second 88200 samples per second x 16 bits per sample / 8 bits per byte = 176400 bytes per second 176400 bytes per second x 10 seconds = 1764000 bytes or 1.764 MB Therefore, a 10-second sound clip sampled at 44100 Hz with 16 bits per sample would require approximately 1.764 MB of storage. However, this calculation is an estimate as the actual storage required can vary depending on the audio format and compression used. Logic Gates Define the Boolean operators: AND, OR, NOT, NAND, NOR and XOR. Construct truth tables using the above operators. Order of precedence applies to logic gates ( ) NOT AND OR Thus, A OR B AND C should be read as A OR (B AND C) Construct a logic diagram using AND, OR, NOT, NAND, NOR and XOR gates. This circuit is a half adder and is used to add bits. It is located in the accumulator (a register that is a temporary store for input and output). Truth table shown below You do not have to memorize the section below. It is purely to give you examples of how truth tables are used using notation ( AND =. ) ( OR = + ) ( NOT = _ )