64
Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland [email protected]

Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland [email protected]

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Introduction to Computer Systems and Software

Lecture 1 of 2

Simon Coupland

[email protected]

Page 2: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Contents

Technology and Computer Evolution Introduction to Computer Systems Computer Hardware Computer Software

Page 3: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer System Users

Types of User: End-user Applications Programmer Low-level Programmer and Hardware Designer

Page 4: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

The End User

The vast majority of computer users are end users

View computers as tools – black boxes Use a set of application programs to achieve

a specific goal or to solve a specific problem: Word processor Spreadsheet CAD (Computer Aided Design) DTP (Desktop Publishing)

Page 5: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

The End User

Purchase is based upon complete set of hardware and software according to application environment,

No need to have knowledge of design, implementation and testing at hardware and software level.

Page 6: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Applications Programmers

People who provide what end users want Computer Scientists or Engineers. Little knowledge of hardware Appreciation for business logic Technically and generally mathematically

literate

Page 7: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Low-Level Programmers and Hardware Designers Electronic engineers Computer scientists Knowledge of machine architecture (Why?) Knowledge of electronics Real-time, bit manipulation and hardware

resources Program in assembler and C Hardware design in FPGA, VHDL and more

rarely ASIC

Page 8: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Low-Level Programmers and Hardware Designers Advantage of using Assembly Language:

Used in industrial time critical applications In-depth understanding;

Instructions (arithmetic, Logical and I/O) Instruction phases (fetch, decode and execute) Information representation (pointers, data)

understanding of processor architecture.

Difference between pointers and data?

Page 9: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Machine Code Very simple low level instructions. A single high level language instruction (e.g. VB)

may require many machine code instructions. An integral part of the processor. An instruction has an operation code (opcode),

followed by zero or more items of data (operands)

© De Montfort University, 2007 CSCI1412-HW-3 9

Page 10: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

A Microcomputer System

Three components: Hardware Software Data

Page 11: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Hardware

The physical equipment: Base unit – printed circuit boards (processor,

memory and I/O), power supply and connections Interface – VDU/monitor, keyboard and mouse Peripherals – Disks, CD/DVD, printers and

scanners

Page 12: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Hardware CPU Components

CU: Control Unit interprets stored instructions in sequence issues commands to all elements of the computer system

ALU: Arithmetic & Logic Unit performs arithmetic and logic instructions

Traditionally the CPU also included RAM: Random Access Memory

holds data, instructions and results of processing temporary (volatile)

Page 13: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Hardware Often, CPU is used to mean just the CU and

ALU the ‘processor’ or ‘microprocessor’ other physical

equipment: Base unit – printed circuit boards (processor, memory

and I/O), power supply and connections Interface – VDU/monitor, keyboard and mouse Peripherals – Disks, CD/DVD, printers and scanners

Page 14: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Hardware

notice that all information enters and leaves the CPU via the RAM

CPU

InputDevices

CommunicationDevicesBacking Storage

OutputDevices

controlunit

arithmetic & logic unit

RAM

(micro-)processor

Why CU and ALU are two separate entities?

Page 15: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Software

A sequence of instructions that tell the computer what to do

Controls the hardware Processes inputs and gives outputs Examples: linux, windows, internet explorer,

gcc, etc

Page 16: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Data

Inputs files Settings – registry, .ini files, .conf files Some cross over - batch files and shell

scripts

Page 17: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Terminology Bit (binary digit, ‘0’ or ‘1’) easy to represent as magnetic fields, light/electrical

pulses, etc. Byte a group of 8 bits nibble = 4 bits (a small byte!) Word a group of bits that can be manipulated by the

processor as a single unit almost always it is a whole number of 8-bit bytes

Page 18: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Terminology memory capacities are currently in billions of bytes disk capacities are in billions or trillions of bytes

Representation?

Kb = Kilobyte = 1024 bytes = 1024 8 bits = 210

Mb = Megabyte = 1024 Kb = (1024)2 bytes = 220

Gb = Gigabyte = 1024 Mb = (1024)3 bytes = 230

Tb = Terabyte = 1024 Gb = (1024)4 bytes = 240

Pb = Petabyte = 1024 Tb =(1024)5 bytes = 250

Page 19: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Instruction and Data Storage

Number representation Fundamental to all computer system is the notion

of a binary digit - 0 or 1 – called a bit. Decimal System (base 10) Binary System (base 2) Hexadecimal System (base 16) Octal System (base 8)

Page 20: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Instruction and Data Storage

Integers (a number with no decimal points) An unsigned byte – range 0 to 255

bit 7 6 5 4 3 2 1 0

value 27 26 24 24 23 22 21 20

value 128 64 32 16 8 4 2 1

01001101 = 1 + 4 + 8 + 64 = 77 10111101 = 1 + 2 + 8 + 16 + 32 + 128 = 187

Page 21: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Instruction and Data Storage

Negative Integers An twos compliment signed byte – range -128 to +127 Most significant bit stores the sign (1 for -, 0 for +) When negative, result = -128 + result

bit 7 6 5 4 3 2 1 0

value -/+ 26 24 24 23 22 21 20

value -128/+ 64 32 16 8 4 2 1 01001101 = 1 + 4 + 8 + 64 = 77 11001101 = -128 + 1 + 4 + 8 + 64 = -51

Page 22: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Instruction and Data Storage Hexadecimal

uses powers of 16:160 = 1161 = 16162 = 256163 = 4,096164 = 65,536165 = 1,048,576

0 = 01 = 12 = 23 = 34 = 45 = 56 = 67 = 7

8 = 89 = 9A =10B =11C =12D =13E =14F =15

Page 23: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Instruction and Data Storage

Real numbers Floating point binary representations are used to

represent real numbers (a number that has a decimal point)

It is possible to use fixed point binary representation, generally not used because of inflexibility

Page 24: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Instruction and Data Storage

Real numbers

3.141592654, 2.9979 108, 6.626 10-34

A number is split into two parts one part describes the number itself (the mantissa) another describes where the decimal point appears (the exponent)

Page 25: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Characters (text)

Text is a collection (an array) of characters Generally characters are encoded in ASCII

(American Standard Code for Information Interchange)

Example: “Hi!”

Character H i !

ASCII value 72 105 33

Binary 01001000 01101001 00100001

Page 26: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Low Level Computer Languages Assembly language

Direct interaction with all parts of the hardware Specific to each microprocessor Great for real-time execution Nearly impossible to code large tasks

Page 27: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Low Level Computer Languages Assembly language

Example on MC680000 seriesCLR.W D3

Clear the lower 16 bit the data register D3

Page 28: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

High Level Computer Languages Higher level of abstract from the hardware Less direct interaction with the hardware Example languages:

C (can be low level) C++ Java BASIC FORTRAN COBOL

Page 29: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

High Level Computer Languages Example in Cint D0 = 7 + 2 * (267 – 23);

Equivalent in MC680000 assemblerMOVE.L #267,D0

SUB.W #23,D0

ADD.W D0,D0

ADD.W #7,D0

Page 30: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Technology and Computer Evolution

Page 31: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

Computer systems are large collections of electronic switches

The power of a computer depends on the number of these electronic ‘binary’ switches

Page 32: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

First Generation (1940’s) Switches were thermionic valves Heated cathode produces negatively charged

electrons Flow of electrons to positive anode controlled by

charged grid Very large Prone to breakdowns

Page 33: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

Thermionic valve / vacuum tube

Page 34: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

Second Generation (1950’s) Switches were transistors The flow of electrons between an ‘emitter’ and a

‘collector’ is controlled by the current supplied to a ‘base’ semi conducting material

5mm in height Don’t breakdown

Page 35: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

The Transistor

Collector Emitter

Base

Page 36: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

Third Generation (1960’s) Switches were fabricated into small scale

integrated circuits (IC’s) Still use semiconductors Many transistors built onto a single chip Much smaller More processing power

Page 37: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

Forth Generation (1970’s to date) Miniaturization is the key Small scale integration 2 - 64 transistors Medium scale integration 64 - 2000 transistors Large scale integration 2000 - 64000 transistors Very large scale integration 64K – 200K

transistors Ultra large scale integration 200K – 100M +

transistors

Page 38: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

Moore’s Law Gordon Moore – co-founder of Intel Transistor density on IC’s will double every

eighteen months

Page 39: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

Page 40: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Generations

Moore’s Law – the limit Research suggests that the smallest possible

transistor will be 16-nanometres Expected to be reached around 2020 Then what?

Quantum computing Bio computing Unknown alternative to the transistor

Page 41: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Page 42: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Page 43: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Components: CPU (Central Processing Unit) Co-Processor (floating-point math, graphics) Primary memory (RAM and ROM) Disk controller Input/Output devices and peripherals

Page 44: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Buses: Address bus – carries address of memory being

accessed Data bus – carries the data Control bus – carries control signals between

CPU and other components

Page 45: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Buses Computer memory is made up of a set of

locations. Each has a unique address.  The address bus specifies the location. The

data bus transfers the data. The control bus determines e.g. read or write

45

Page 46: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

The System Clock What controls the fetch / execute cycle?

the system clock this is a quartz chip that provides pulses at a

regular, rapid, rate, like a metronome n.b. not the same as the real date / time clock

The first microprocessor originally ran at 100 KHz, the Pentium IV is now at 1.2 – 4.0 GHz

A clock tick starts the fetch / execute cycle it may take several (perhaps tens of) clock ticks to

complete one complex instruction

© De Montfort University, 2007 CSCI1412-HW-3 46

Page 47: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

GigahertzThe ‘simplest’ measure of speed is just the rate

at which the system clock ticks usually quoted in Gigahertz (GHz)

1 Hertz = 1 cycle per second 1 Megahertz = 1 million cycles per second 1 Gigahertz = 1 billion cycles per second

This is meaningful in one type of processor e.g. 2.4 GHz Pentium is twice as quick as 1.2 GHz

But is not for comparing different processor types different processors may take different numbers of

cycles to fetch / execute the ‘same’ instruction e.g. a Pentium takes X cycles to load a number into the

accumulator, whereas a 68040 takes Y cycles

© De Montfort University, 2007 CSCI1412-HW-3 47

Page 48: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Memory: Registers – store temporary data within the

processor Cache – stores temporary data that is likely to be

used with the processor Primary memory – RAM, stores programs being

executed Secondary memory – Disks, persistent storage

Page 49: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Memory: Organised as a table: 0

1

2

3

4

5

6

7

8

9

Page 50: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Inside the CPU

Clock

RAMExternal cache memory

ALU

Data Instruction

Internal cache memory

Control unit

Pipeline

DataAddress

Control

Page 51: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Inside the CPU – The Control Unit In overall control of the computer system Controls the fetch/execute cycle Registers:

Program counter – hold the memory address of the next word in the current instruction

Instruction register – holds the next instruction to be executed

Page 52: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Inside the CPU – Fetch/Excute Fetch

Fetch the instruction from memory. Decode it and it the instruction has a indirect memory address find out the effective address in memory.

Execute Execute the instruction by send the series of signals

from the control unit to the ALU. Store the result or send it to an output device.

Page 53: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

The Fetch / Execute Cycle

53

control unit

RAM

arithmetic / logic unit

decode execute

fetch (store)

Page 54: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Inside the CPU – the Arithmetic/Logic Unit Integer arithmetic – addition, subtraction,

multiplication and division Logical operations – not, and, or, exclusive or

and Bit shift operations Data, address and status registers

Page 55: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Hardware

Co-Processors Mathematical – to perform high speed floating

point number calculations Graphical – to produce video output from

computer models. Modern graphics co-processors often implement an API (DirectX, OpenGL) in hardware

Page 56: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Software

Page 57: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Software

System start-up Uses firmware (software stored in ROM) generally

called the BIOS, Basic Input/Output System Initialises hardware Performs Power On Self Test Starts the operating system

Page 58: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Software

Operating System – OS Controls hardware and software Windows, Linux, MAC OS X Provides the initial front end experience to the end

user Does all the backroom work to keep things

running smoothly

Page 59: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Software

Assemblers, Compilers and Interpreters Assemblers convert assembly language into

machine code Compilers convert text written a programming

language into machine code. Cross assemblers/compilers convert code into

machine code for a different machine Interpreters execute programming code on line at

a time

Page 60: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Computer Software

Java – the Exception Originally called Oak, java was intended to be the

de facto language for embedded systems The Java compiler javac converts java text in

machine independent byte code Each machine or piece of hardware has a Java

Virtual Machine (JVM) which converts byte code into machine code and executes it

Write once, run anywhere (slowly!)

Page 61: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Recap

Three types of people in computing:

Page 62: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Recap

Three types of people in computing: End users – our customers Applications programmers – people who

understand a little about computers and write all the software the we use. Use C, C++, Java, VB

Hardware programmers/designers – people who know a lot about electronics, they built gadgets and the software the underpins the applications software. Use VHDL, assembler, C

Page 63: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Recap

What is a Computer?

Page 64: Introduction to Computer Systems and Software Lecture 1 of 2 Simon Coupland simonc@dmu.ac.uk

Recap

What is a Computer? A big collection of electronic binary switches The switches are actually very small transistors

jammed onto silicon wafers - chips CPU (Central Processing Unit) Co-Processor (floating-point math, graphics) Primary memory (RAM and ROM) Disk controller Input/Output devices and peripherals