Computer Organization IB Computer Science Topic 2

download Computer Organization IB Computer Science Topic 2

of 23

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of Computer Organization IB Computer Science Topic 2

  • Slide 1
  • Computer Organization IB Computer Science Topic 2
  • Slide 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]
  • Slide 3
  • Machine Instruction Cycle Overview FetchDecode Execute Store
  • Slide 4
  • Components of the CPU You need to be able to reproduce this diagram and discuss everything in it Control Unit Registers Arithmetic Logic Unit Memory [01] [02] [..] [FF] Address Bus Data Bus MAR MDR
  • Slide 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.
  • Slide 6
  • 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.
  • Slide 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]
  • Slide 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
  • Slide 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 processs or one user's memory space separate from anothers Built-in firewall
  • Slide 10
  • Levels of Memory Primary 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
  • Slide 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 dont need to worry about the complications of the underlying physical structure of memory and disk (another example of abstraction)
  • Slide 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 Email: 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.
  • Slide 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.
  • Slide 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]
  • Slide 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 2 4 = 16, one Hex digit can be used to represent 4 bits, and two Hex digits can be used to represent a byte.
  • Slide 16
  • Data Representation The Guide mentions: Strings, integers, characters, colours. The most basic point is that more bits allows more different values to be stored. 0101 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 No bitsNo diff values 12 24 38 416 532 n? More bits means: More different values Data is larger
  • Slide 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
  • Slide 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.
  • Slide 19
  • Logic Gates 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
  • Slide 20
  • Redraw each of these diagrams using fewers gates NOT AND A B X NOT AND A X B OR
  • Slide 21
  • Harder NOT OR AND A B X C Write a boolean expression for the following logic diagram Construct its truth table Construct a logic diagram for the following boolean expression: A AND (B OR NOT C)
  • Slide 22
  • IB Example Maria wont 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?
  • Slide 23
  • IB Example: Maria wont 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 or not C R H S CRHC and RNot HC and R or Not HS = Not(C and R or Not H) 0000110 0010001 0100110 0