Topic.2- Computer Organization Designed by: Allan Lawson Sources: Online Materials, thanks for all
Topic 2.1.1 Computer Architecture Outline the architecture of a central processing unit (CPU) and the functions of the arithmetic logic unit (ALU) and the control unit (CU) and the registers within the CPU. Key Terms: CPU = Central Processing Unit ALU = Arithmetic Logic Unit CU = Control Unit Registers = small temporary storage spaces inside the CPU Central Processing Unit Video: How are CPUs made CPU definition: The key component of a computer system, which contains the circuitry necessary to interpret and execute programing instructions for the computer device. CPU
Examples of ALU s & CU s Topic 2.1.1 Function of the ALU Part of the CPU that does all the arithmetic (+/-) and logical (AND/OR) calculations Sometimes an ALU is referred to a core, hence computers with dual core technology have two ALU s to process two calculations simultaneously. Two functions of the CU: It handles the loading of new commands into the CPU and the decoding of these commands. Also, it directs the data flow and the operation of the ALU. Computer Architecture: In 1945, a scientist called Von Neumann suggested that a computer system be slip into a processor module (where the instructions are calculated) and a memory module (where instructions and data are stored). We still use this model today: CPU and Primary Memory
Topic 2.1.1 Special relationship between CPU & RAM CPU needs it s own memory Registers: they are small, very fast circuits that store intermediate values from calculations or instructions inside the CPU. There are many small units, but the four most important ones are the following: 1. MAR 2. MDR 3. Accumulator 4. Program Counter Program Counter & Accumulator Program Counter holds the memory address of the next instruction. Accumulator holds the intermediate results of the currently running instructions. MAR (Memory Address Register) MAR is connected to the address bus. MAR contains a memory address. MAR s sole function contains the RAM address of the instruction the CPU wants next.
Topic 2.1.1 MDR ( Memory Data Register) MDR is connected to the data bus. MDR holds data that will be written to the RAM or that was read from RAM. Relationship between MAR & MDR: The MAR gives the address the data of the MDR will be read from or written to.
Topic 2.1.2 Describe the Primary Memory.
RAM = Random Access Memory Contains the data and instructions the computer has loaded since starting up and everything the user has opened or loaded. Is volatile = loses its contents if the power is lost Has a special link to the CPU Topic 2.1.2 ROM = Read Only Memory Originally its contents were static ( read only ) and could not be changed not true any more ( flash upgrades ). Non-volatile = does not lose its contents if the power is lost Stores the BIOS (Basic Input Output System) a small program that allows the computer to know what to do to find the operating system to boot the computer after power is restored. RAM Volatile Contains user s programs and data that has been loaded since booting up Usually measured in Gigabytes (common capacities are 1GB, 2GB or 4GB) ROM Non-Volatile Contains the BIOS Usually measured in Kilobytes (much smaller than RAM)
Connections between RAM & CPU Control Bus (bi directional) Address Bus (uni directional-from CPU to RAM only) Data Bus (bi directional) Topic 2.1.2 Bus = a set of wires that connect two components in a computer system Topic 2.1.3 Explain the use of cache memory.
Topic 2.1.3 Memory Primary Secondary RAM HDDs ROM Flash Cache Definition: Cache A type of small, high-speed memory inside the CPU used to hold frequently used data, so that the CPU needs to access the much slower RAM less frequently
Topic 2.1.3 Topic 2.1.4 Explain the machine instruction cycle. Simplified model:
Simple Model #2 Topic 2.1.4 Video's Tutorials to explain Video 1: Video 2: Topic 2.1.5 Identify the need for persistent storage
Why do we need storage? Topic 2.1.5 Processing done in CPU * Has no storage Stores results / data in RAM * RAM is volatile (looses contents if power is lost) * HDD/SSD Needs to be stored on persistent storage Types of storage
Software Topic 2.1.6 Describe the main functions of an operating system Hierarchy of Software Operating System System Software Utilities Drivers / Libraries Application Software Games Word processor Productivity Spread sheet Specialist Browser
Topic 2.1.6 Functions of an operating system A. Provides a user interface B. Does memory management C. Does peripheral management D. Allows multi-tasking E. Provides security A. User interface OS has to provide a link between the user and the computer hardware. Types of user interfaces: Graphical User Interfaces (GUIs) that have menus and icons, graphics, desktop style. Command Line Interfaces (CLIs) where the user types in codes, data entry style. Natural Language Interface (NLIs) where the user speaks to the interface. Menu Based Interface (MBIs) which gives the user a selection of options.
Examples of user interfaces Topic 2.1.6 GUI CLI NLI MBI B. Memory Management Memory management is done by keeping track of storage devices (like HDD) and controlling which application has access to which area of memory (RAM). Each location in memory can be read, modified, and written to by the OS. When the memory location is full the OS sends a confirmation message. Similarly, the OS provides file management services by sorting out where data is stored on the disk drives and memory. The OS allows users to organize files in folders as well as to copy and delete files. Examples of memory management File manager for managing files on HDD Memory manager for RAM to make sure programs don t use same memory space
C. Peripheral management Topic 2.1.6 The OS coordinates the basic input and output systems (the BIOS). Keyboard, mouse, monitor and printers are controlled through device drivers. A device driver is a software program which allows hardware devices to be used by the OS. They act as translators between the devices and the computer system. Peripheral management example
D. Multitasking Topic 2.1.6 The OS coordinates the working of different programs by allocating the CPU time between different programs based on time and priority of the software application. Each task running is given a slice of time, or a turn on the CPU. Each task has to wait its turn unless it is given a higher priority by the OS in which case it gets more or longer time slices. Multitasking Example E. Security OS prevents unauthorised access. It ensures security of the system through user names and passwords. The OS protects files from other users reading or writing files.
Security Examples Topic 2.1.6 Topic 2.1.7 Outline the use of a range of applications software Hierarchy of software
Topic 2.1.7 Common application software Word processors Spreadsheets Database Management Systems (DBMS) Email clients Web browser Computer Aided Design (CAD) Graphic Processing Software Word Processor (not just Word) A program for storing, manipulating, and formatting text entered from a keyboard and providing a printout. Spreadsheet (not just Excel) A program in which data is arranged in rows and columns of a grid and can be manipulated and used in formulas and calculations.
A database management system (DBMS) is a system software for creating and managing databases. The DBMS provides users and programmers with a systematic way to create, retrieve, update and manage data. Topic 2.1.7 Database Management System Email clients (not outlook like Hotmail) A computer program used to access and manage a user s email. Web browser A software application for retrieving, presenting, and traversing information resources on the World Wide Web.
Topic 2.1.7 Computer Aided Design (CAD) Programs that use computer systems to assist in the creation, modification, analysis, or optimization of a design. Graphic Processing Software In computer graphics, graphics software or image editing software is a program or collection of programs that enable a person to manipulate visual images on a computer.
Identify common features of applications. Topic 2.1.8 Common features of most programs are: Toolbars Menus Dialogue Boxes GUI components OS vs Application features Certain parts of the interface are provided by libraries in the OS and certain parts are specific to each application For example: the menu bar and buttons are standard, but the specifics/pictures are up to the individual application OS Generic Program Specific
Topic 2.1.9 Define the terms: bit, byte, binary, denary/decimal and hexadecimal Definition: bit Computers use binary - the digits 0 and 1 - to store data. A binary digit, or bit, is the smallest unit of data in computing. It is represented by a 0 or a 1. Define: byte Bits can be grouped together to make them easier to work with. A group of 8 bits is called a byte. Common byte storage capacities
Topic 2.1.9 Define the terms: bit, byte, binary, denary/decimal and hexadecimal Definition: binary Computers use binary - the digits 0 and 1 - to store data. Because it only has 2 symbols (0 & 1) it is also called BASE-2 numbering Binary also refers to the format in which numbers are transmitted and calculated in a computer system. Relationship between normal numbers (denary) and binary How to convert from binary to denary:
Definition: denary / decimal Topic 2.1.9 Denary is a numbering system with 10 symbols: 0123456789 It is, therefore, often referred to as BASE-10 numbering. Definition: hexadecimal Hexadecimal is a numbering system with 16 symbols: 0123456789ABCDEF It is, therefore, often referred to as BASE-16 numbering. Hex, as it is often called, is used to represent very large numbers quickly, such as those used in colour representation. Hexadecimal to Denary Binary to Hexadecimal
Topic 2.1.10 Outline the way in which data is represented in the computer Many different representations: String ( I love Java ) Integer (12, 34, 3345 ) Characters (ASCII vs Unicode) Colours (Hex) What is 10101111? Is it a number (integer)? Is a character? If it is a character, what table am I going to use look up the character? ASCII? Unicode? Does it refer to a colour? Is it part of a picture? ASCII vs Unicode Different data types take up more space Bytes taken up in RAM 22 1 2 4 8 boolean char int double String "Hello World"
Topic 2.1.10 Colours as HEX numbers Define the Boolean operators: AND, OR, NOT, NAND, NOR and XOR Topic 2.1.11 What is logic? Its how a machine will solve problems. Machines (at basic level) do not understand semantics like humans no grey areas. 1 0 True/On/Yes False/Off/No
Topic 2.1.11 The Basic 3 gates AND OR NOT The Further 3 gates NAND NOR XOR Combining gates A B A B A B D Q Q = NOT (A AND B) Q Q = NOT (A NOR B) Q Q = C AND (A OR B) C In reality Where can we find these gates in reality?
Topic 2.1.11 Common uses of gates: Gate Example Fire alarm: Smoke (1) AND heat (1) Internal car light: Either door opened (1) Microwave will stop (0) if the door is opened (1), vice versa Security system is engaged until you enter code or an ID is scanned, the it disengages. Air conditioner: AC will turn on (1) only if BOTH window A and B are closed. (0) 2 light switches in one corridor Construct truth tables using AND, OR, NOT, NAND, NOR and XOR Topic 2.1.12 The Basic Truth Tables Multiple gate truth table How many combinations do we need to test in the table? A B C A and B Not C A.B or C Not(A.B or C) Y 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 1 0 0 1 0 1 0 0 0 1 1 Practice on these 1 1 0 1 1 1 0 0 1 1 1 1 0 1 0 0
Topic 2.1.13 Construct a logic diagram using AND, OR, NOT, NAND, NOR & XOR Good news Bad news? In exams the exact symbol is not relevant. You can use the official: Or the IB version: AND OR NOT Past exam question Turn the following logic statement into a logic diagram: Y = NOT [ (A AND B) OR NOT C ]