computer studies computer memory and data transfer
TRANSCRIPT
Computer Studies
Computer Memory and Data Transfer
Computer StudiesHardware A General Overview
– What is a computer?• A computer is a machine that processes data and produces
information.
– How does it function?• Before it can do anything, programs must be installed to give
the computer the instructions on how to process the information.
• This is done using an input device.
– What happens then?• When the computer is finished processing, it produces results.
• This is shown through an output device.
Computer Hardware
Backing Storage
CPU
Central
Memory
INPUT
OUTPUT
Computer StudiesHardware - The Basics
Computer StudiesOrganisation of Data
The main memory of a computer is used to store programs and data. The memory size is measured in kilobytes, megabytes, or gigabytes.
KILOBYTE 1024 bytesMEGABYTE 1024 x 1024 bytesGIGABYTES 1024 x 1024 x 1024 bytes
Different types of MemoryROM Once programmed it cannot be erasedEPROM Can be erased by exposure to UV light.EAPROM Can be partially programmed or ‘flashed’
which changes the original coding.
Computer StudiesOrganisation of Data
Data is organised in a number of different units of storage.
BIT the smallest unit of storage can store a 0 or 1BYTE a collection of 8 bitsNIBBLE a group of 4 bits or half the length of a byteWORD a group of bits stored by the computer as a
single unit – usually multiples of 8 bits.
A 16 bit computer will work with words 16 bits long.Most modern computers will work with words 32 bits long or higher.
Computer StudiesHardware – data organisationWord Length
– A group of bits that can be transferred and manipulated as a single unit by the CPU.
– The amount of bits the CPU can send or receive at once.• An 8 bit CPU will send or receive 8 bits of data.• A 16 bit CPU will send or receive 16 bits of data.
– A computer with an 800 mhtz which has a word length of 2 bytes (16 bit) is twice as fast as the same processor with 8 bit data transfer rate so it performs functions in half the time.
Computer StudiesHardware
The Data and Address Bus - A series of copper strips that act as highways along which data travels
between the CPU, Memory, and peripherals.
Anything that requires the transfer of data is connected to the bus.
It is the method by which information moves across the computer system:
– Data Bus:
– It’s width determines the amount of
information that can be transferred.
– Address Bus:
– Travels with the data along the bus.
Computer StudiesHardware – General Overview
The Data and Address Bus act like a letter. The address part is the envelope, and the data section consists of the letter. The address bus helps the computer find the correct location – and deliver the information inside the envelope.
They travel together.
Computer StudiesThe Basic Computer
Central Memory -
Made up of two main parts:
– Random Access Memory
– Read Only Memory
RAM• It is the working ‘desk’ of the
computer.• Programs run in RAM. • Used for temporary storage of
Data and programs.• It is volatile – information is lost
when power is lost.• Because of this backing storage is
needed.
WHAT DOES RAM DO?
Computer StudiesThe Basic Computer
Central Memory -
Made up of two main parts:
– Random Access Memory
– Read Only Memory
ROM• Stores data required permanently.• Programs run in RAM. • Instructions are normally encoded
during the manufacture of the chip.• The contents cannot be changed.• Because of this backing the Rom
normally contains the booting instructions needed to start the computer.
WHAT DOES ROM DO?
Computer StudiesThe Basic Computer
Storage
Backing Storage• Much higher Capacity than RAM or
ROM.• Stores data for a permanent period. • Different forms such as:
• Hard Disks• Magnetic Tape• Floppy Disks• CD Roms.
WHAT DOES BACKING
STORAGE DO?
Computer Studies
Machine Code - – The CPU only understands machine code – binary digits – a series
of 0’s and 1’s.
– An ‘instruction set’ is a group of instructions understood by the CPU.
– Different generations of CPU’s have their own instruction sets.
Assembly Language– A separate programming language called ‘assembly language’ was
created which is easier to understand.
– These are called ‘low level languages.
– Programmers need to learn these languages before they can program a computer.
– Uses abbreviated words to give the computer commands - Mnemonics
Hardware – The CPU
Computer StudiesHardware - The CPU
CPU - Made up of two main parts:
– Arithmetic Logic Unit
– Control Unit
ALU
Performs mathematical calculations
CU
Manages and controls all movements to and from all peripherals to the CPU
Computer StudiesHardware - Speed The CPU Speed
– Depends on the internal clock of the CPU?• Sometimes referred to as ‘clock speed’
• Measured in MHz or MIPS (millions of instructions per second).– Hertz is one cycle per second– MHz is one million cycles per second
(megahertz)– MIPs are millions of instructions per second
– Today’s computers operate at millions of cycles per second (e.g.. Pentium IV – 266)
There are other factors that effect the computer’s speed.
Computer StudiesHardware - Speed The Cache
– A type of very fast Memory• It can be part of the CPU or it can be external – e.g.. Placed
on the motherboard near the CPU.
• Used to carry out calculations and repetitive actions.
• These are then passed back to the CPU.
• Cache allows the CPU to perform other functions at the same time.
• Different sizes of cache: 128k, 256k, 512k.
Computer StudiesHardware - The CPU
Control Unit - The manager of the computer. It’s primary functions are:
– Carry out the instructions stored in memory
– Contains the
– Instruction register
– Stores a copy of the current instruction that is being processed.
– Program counter
– Stores the location of the next instruction to be executed.
Computer StudiesHardware
Arithmetic Unit - Two main sections:
– The Accumulator:
– Stores the current results of a calculation
– The Shift Register:
– Moves it’s contents one or more positions to the right or left in order to carry out arithmetic operations.
Computer StudiesHardware – The CPU
Arithmetic Unit - The calculator of the computer. It’s primary functions are:
– Carries out the instructions that require mathematical calculations
– Carries out Mathematical Functions:
– Addition, Subtraction, Multiplication and Division
– Greater than>, Less than<, Equal to=
– Greater than or equal to>=, Less than or equal to<=,
– Not equal to<>,
– The three logical Functions:
– NOT
– AND
– OR
Hardware
Block
Diagram
Computer Studies Fetch Execute Cycle
– A) Set the value of the program to the address of the 1st instruction.
– B) Fetch the instruction from the location specified by the program counter.
– C) Store a copy of this instruction in the instruction register.– D) Increment the program counter by 1.– E) EXECUTE the instruction:
– Fetch any data required by the instruction– Place it in storage locations within the ALU called Data Registers.– Activate the correct circuits for the instruction to be carried out.– Move any results from the data registers back to main memory.
– F) Repeat process from step B.
Computer StudiesThe Fetch / Execute Cycle
Computer StudiesSample Machine / Assembly (Programming) Code
0000 END Stop the Execution of a program
0001 ADD Add the contents of the memory location to the accumulator.
0010 SUB Subtract the contents of the memory location to the accumulator
0011 MULT Multiply the contents of the ML to the accumulator
0100 DIV Divide the contents of the ML into the accumulator
0101 LDA Copy the contents of the ML into the accumulator
0110 STO Copy the contents of the Accumulator to the ML
0111 IN Input from Input Unit to the ML
1000 OUT Output Contents of the ML to the Output Unit
1001 JMP Transfer control to the Instruction in a Named Location.
1010 JNZ Jump (skip) if contents of the accumulator is not zero
Computer StudiesA simple program to add two numbers input from the
keyboard
100 IN Accept a number from the KB and store it in ML 100
101 IN Accept a number from the KB and store it in ML 101
100 LDA Load the number stored in ML 100 in to the accumulator
101 ADD Add the number stored in ML 101 into the accumulator
102 STO Store the value currently in the accumulator into ML 102
102 OUT Output the value stored in ML 102 into an output device
Computer StudiesA simple program to add two numbers input from the
keyboard
100 IN Accept a number from the KB and store it in ML 100
101 IN Accept a number from the KB and store it in ML 101
100 LDA Load the number stored in ML 100 in to the accumulator
101 ADD Add the number stored in ML 101 into the accumulator
102 STO Store the value currently in the accumulator into ML 102
102 OUT Output the value stored in ML 102 into an output device
Peripherals– Input and Output devices
• The computer receives instructions from the input peripherals.
• Displays results on the output peripherals.• Holds information on secondary storage
peripherals.
Computer Studies
Peripherals– Input Devices
• Keyboard• Mouse• Light Pen• Digital Camera• Digitizing Tablet• Bar Code Reader
Computer Studies
Peripherals– Input Devices
• Speech Reader• Magnetic Ink Character Reader• Hand Held Terminal• Touch Screen• Optical Character Reader (OCR)• Scanner
Computer Studies
Output Peripherals
Soft copy- Visual (monitor) or
spoken (speakers) Hard copy – computer output on a
tangible medium such as paper