Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Organization

Similar presentations


Presentation on theme: "Computer Organization"— Presentation transcript:

1 Computer Organization
IB Computer Science Topic 2

2 Outline the four phases of the machine instruction cycle. [8 marks]
Draw a block diagram showing the basic components of the CPU and how they interact with memory. [8 marks]

3 Machine Instruction Cycle Overview
Fetch Decode Execute Store

4 Components of the CPU You need to be able to reproduce this diagram and discuss everything in it Control Unit Registers Arithmetic Logic Memory [01] [02] [..] [FF] Address Bus Data Bus MAR MDR

5 Registers Registers are the smallest and fastest unit of memory in a computer system, and are used to store information that the CPU is working on at that exact moment. Registers you need to know about: Program Counter: Stores the address of the next instruction Memory Address Register: Stores the address in memory that is to read or written. Memory Data Register: Stores the data in memory that has been read or is to be written. Instruction Register: Stores the current instruction being processed. Accumulator: A set of general purpose registers used for storing temporary intermediate results of the CPU's calculations.

6 The Store Phase (optional)
The Fetch Phase The PC (Program Counter) stores the address of the next instruction in memory. The contents of the PC are copied to the MAR and the PC is incremented. The address is put onto the address bus. The data at that address is read into the MDR. The data returns on the data bus. The Decode Phase The instruction carried by the MDR is copied to the IR (Instruction Register) The instruction is translated into a format that the ALU can understand. The Execute Phase The ALU carries out the operation, e.g. ADD, MUL, CMP, JMP, STO, etc. The Store Phase (optional) This is almost exactly the same as the Fetch phase, except that the control bus carries a "write" signal instead of a "read" signal. Therefore, instead of reading the data stored at the MAR address into the MDR, the data stored in the MDR is written to the location at the MAR address.

7 Questions Draw a block diagram showing the basic components of the CPU and how they interact with memory. [8 marks] Explain why the address bus is unidirectional and the data bus is bidirectional. [4 marks] Outline the four phases of the machine instruction cycle. [8 marks] Compare the roles of the Memory Address Register and the Memory Data Register. [4 marks]

8 Operating Systems Operating System: Software that controls the execution of programs and that may provide services such as resource allocation, scheduling, input/output control, and data management. How many operating systems can you name? Main functions: A collection of programs Input/Output (IO) control File management Software/hardware interface Memory management User interface Scheduling Program execution control Security

9 Operating Systems and Security
User management: login with password System of privileges, determining which user or process can do what, eg delete files, shut down the system, etc Permissions for files and directories, eg read-only Memory management: keeping one process’s or one user's memory space separate from another’s Built-in firewall

10 Levels of Memory Primary Memory Secondary Memory
Registers: Smallest, fastest memory, used to hold data that the CPU is currently working. Cache: Small, fast memory, used to hold very frequently used data. RAM: Random Access Memory. Holds data and instructions from running programs. ROM: Non-volatile memory, used to hold the operating system's bootstrap loader (small start-up program) or BIOS. Secondary Memory Disk storage Magnetic tape USB flash drives

11 Operating Systems and Memory Management
Multi-tasking environment: keeping the memory space of each process safe from other running processes (see Security) Multi-user environment: keeping the memory space (primary and secondary) of each user safe from other users (see Security) Allocating and deallocating memory for each process Paging: Dividing virtual memory up into equal- sized blocks (pages) Paging allows OSs to allocate non-contiguous chunks of memory to the same process, thus reducing fragmentation problems Virtual memory: The use of secondary memory as if it were primary memory. By creating virtual memory, the OS make it easier for programs to reference memory because they don’t need to worry about the complications of the underlying physical structure of memory and disk (another example of abstraction)

12 Applications An application is a computer program that allows a user to perform some useful activity. Examples are: Word processor: Text document management Spreadsheet: Mathematical and financial calculations Database: Organisation of information Electronic mail Web browser: Viewing HTML pages Graphics processing: Editing, cropping and enhancing images Computer-Aided Design (CAD): Creating and editing designs for engineering or manufacturing Note that you are not allowed to use proprietary names in your exam. So you say "spreadsheet software" and not "MS Excel", etc.

13 Common Features of Applications
The IB Guide refers to features: "Including toolbars, menus, dialogue boxes, graphical user interface GUI) components. Students should understand that some features are provided by the application software and some by the operating system." Operating systems make services available to applications: I/O (input/output) operations File system manipulation (reading/writing files) Frameworks of GUI components Program execution Hardware interface Error detection All applications need these services, so it makes sense to centralise their provision. They make the development of software simpler because potentially complex interaction with hardware is avoided.

14 Questions Outline the main functions of an operating system. [4 marks]
Explain the advantages of virtual memory. [4 marks] In what ways can an operating system improve information security in a computer? [4 marks]

15 Binary Representation
Definitions Bit: The smallest amount of data that can be represented. Short for "binary digit". Represented as either a 0 or 1. Byte: 8 bits Denary/Decimal: The base 10 counting system. The normal place- value counting system in which a new column is created when a power of 10 is reached. Hexadecimal: The base 16 counting system. Requires six new symbols in addition to 0-9, which are A-F. Since 24 = 16, one Hex digit can be used to represent 4 bits, and two Hex digits can be used to represent a byte.

16 Data Representation No bits No diff values 1 2 4 3 8 16 5 32 n ?
The Guide mentions: Strings, integers, characters, colours. The most basic point is that more bits allows more different values to be stored. No bits No diff values 1 2 4 3 8 16 5 32 n ? 1 00 01 10 11 000 001 010 011 100 101 110 111 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111 More bits means: More different values Data is larger

17 Raster images Also called bitmaps, raster images use a grid of points of colour But how many different colours can one point be? Colour depth is the number of bits per pixel (generally "bit depth") (The number of pixels makes a difference too.) Obvious tradeoff between picture quality vs file size

18 Questions An image file is made up of a grid of 200 x 300 pixels and has a colour depth of 8 bits. How many different colours can each pixel represent? [2 marks] What is the size of the file? [2 marks] A friend argues that if you increase the colour depth of this file, you will improve its quality. To what extent is he correct? [4 marks] General knowledge! What does RGB stand for? How many colours can RGB represent? What are the RGB values for: white? black? What colour is: 888888? 00FFFF? Why is ASCII vs Unicode relevant to this topic? Explain one advantage and one disadvantage of Unicode over ASCII.

19 Logic Gates A B X C The Guide mentions AND, OR, NOT, NAND, NOR, XOR
Which of these are binary operators and which are unary operators? Construct truth tables for each. Look at the logic diagram below. Construct a truth table for X given the inputs A, B and C. AND NOT XOR A B C X

20 Redraw each of these diagrams using fewers gates
NOT A AND X NOT B NOT AND A OR X AND B NOT

21 Harder Write a boolean expression for the following logic diagram
Construct its truth table NOT A AND X B OR C Construct a logic diagram for the following boolean expression: A AND (B OR NOT C)

22 IB Example Maria won’t go to school if it is cold and raining or she has not done her homework Draw a logic diagram Construct a truth table Huh?! Think… What are the inputs? What is the output? What are the Boolean operators?

23 IB Example: Maria won’t go to school if it is cold and raining or she has not done her homework.
Inputs Cold Raining Done Homework Outputs: Go to School and R or not S H not C R H C and R Not H C and R or Not H S = Not(C and R or Not H) 1


Download ppt "Computer Organization"

Similar presentations


Ads by Google