Topic 2 Computerorganization PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

IB Computer Science Designed by:

Topic.2- Allan Lawson


Sources: Online Materials, thanks for all

Computer Organization
IB Computer Science
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
IB Computer Science
Topic 2.1.1
Examples of ALU’s & CU’s

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
IB Computer Science
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.
IB Computer Science
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.
IB Computer Science
Topic 2.1.2

Describe the Primary Memory.


IB Computer Science
Topic 2.1.2

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

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 ROM

Volatile Non-Volatile

Contains user’s programs and data Contains the BIOS


that has been loaded since “booting
up”
Usually measured in Gigabytes Usually measured in Kilobytes (much
(common capacities are 1GB, 2GB or smaller than RAM)
4GB)
IB Computer Science
Topic 2.1.2

Connections between RAM & CPU


• Control Bus (bi directional)
• Address Bus (uni directional-from CPU to RAM only)
• Data Bus (bi directional)
• Bus = a set of wires that connect two components in a
computer system

IB Computer Science
Topic 2.1.3

Explain the use of cache memory.


IB Computer Science
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
IB Computer Science
Topic 2.1.3

IB Computer Science
Topic 2.1.4
Explain the machine instruction cycle.

Simplified model:
IB Computer Science
Topic 2.1.4
Simple Model #2

Video's Tutorials to explain


Video 1: Video 2:

IB Computer Science
Topic 2.1.5
Identify the need for persistent storage
IB Computer Science
Topic 2.1.5
Why do we need “storage”?

Processing done in * Has no storage


CPU

Stores results / data * RAM is volatile


in RAM (looses contents if power is lost)

Needs to be stored
* HDD/SSD on persistent
storage

Types of storage
IB Computer Science
Topic 2.1.6
Describe the main functions of an
operating system

Hierarchy of Software
Operating System

System Software
Utilities
Software

Drivers / Libraries

Application
Software Games Word processor

Productivity Spread sheet

Specialist Browser
IB Computer Science
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.
IB Computer Science
Topic 2.1.6
Examples of user interfaces
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
IB Computer Science
Topic 2.1.6

C. Peripheral management
• 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


IB Computer Science
Topic 2.1.6

D. Multitasking
• 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.
IB Computer Science
Topic 2.1.6

Security Examples

IB Computer Science
Topic 2.1.7

Outline the use of a range of


applications software

Hierarchy of software
IB Computer Science
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.
IB Computer Science
Topic 2.1.7

Database Management System


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.

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.
IB Computer Science
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.
IB Computer Science
Topic 2.1.8
Identify common features of applications.

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
IB Computer Science
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


IB Computer Science
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:


IB Computer Science
Topic 2.1.9

Definition: denary / decimal


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
IB Computer Science
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

8
4
1 2

boolean char int double String "Hello World"


IB Computer Science
Topic 2.1.10
Colours as HEX numbers

IB Computer Science
Topic 2.1.11
Define the Boolean
operators: AND, OR,
NOT, NAND, NOR and
XOR

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
IB Computer Science
Topic 2.1.11
The Basic 3 gates
AND OR NOT

The Further 3 gates


NAND NOR XOR

Combining gates
A
Q Q = NOT (A AND B)
B
A
Q Q = NOT (A NOR B)
B
A D
B
Q Q = C AND (A OR B)
C

In reality…Where can we find these gates in reality?


IB Computer Science
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

IB Computer Science
Topic 2.1.12
Construct truth tables using AND, OR, NOT,
NAND, NOR and XOR

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
1 1 0 1 1 1 0 0
Practice on these… 1 1 1 1 0 1 0 0
IB Computer Science
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 ]

You might also like