54
System Environment Part 1 The Register Level

System Environment Part 1 The Register Level. Module Content “Systems environment” is a term used to describe the hardware and software structures which

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

System Environment

Part 1The Register Level

Module Content “Systems environment” is

a term used to describe the hardware and software structures which allow applications programs like Word, Excel etc. to operate.

This module explores this environment in two important respects: 1. The functioning of the

microprocessor2. The working of the Operating

System

Structure of the Module 1

This module is split into 3 sections, each lasting approximately 4 weeks:

Processor Operations at the Register level

Processor Operations at the digital logic level

Computer Operations at the system software level

Structure of the Module 2

Each week there will be two 2-hour sessions:

Practical Session (2 Hours) In this session we will look at the exercises

and carry out ‘hands-on’ workshop activities.

Main Lecture (1 hour) In this session we will look at theory (mainly

hardware stuff)

Assessment

Assessment Comprises:

Three in-class tests 60%Week 5: Machine level programs 20%Week 9: Circuit design 20%Week 12: Operating Systems 20%

Two-hour written examination 40%

Taking the Lid off the Computer

What do we know about computers?

5-minute buzz group activity 1

What do we mean by a computer system?

Where do we find such systems?

Computers

A Computer System means the set of hardware and software components which cause the computer to function.

We find theses systems in obvious places like group of boxes on your desktop, but also in less likely places: Cars Washing Machines Microwaves Etc.

What else do we know about computers?

10-minute buzz group activity 2

Turn to page 18 in the notes.

Can you explain any or all of the terms?

Can you put names to…Set of instructions to be executed

Program to translate machine level instructions to binary

Electronic circuit which can be in one of two states

Collection of bi-stable cells representing a binary number

Hard-wired program needed to carry out a single CPU instruction

Information highway within a computer

Number represented by a sequence of 0’s and 1’s

Data storage facility General purpose information processing tool

Program which controls computer functionality

Electronic circuit which can be in one of two states

Number represented by digits 0,1..9 and the letters A,B.. F

Measurement of the speed of the CPU

Overriding CPU program which checks for input

Program which converts language to computer instructions

Taking the Lid off Computer Systems

In the next few slides we will delve deep into the workings of the computer, using the process of “taking the lid off the box”

Each level we encounter will need its own and structures in order to operate effectively.

Diagram 1The HCI Level

Computer System

User

What rules do you know about working at the Human-Computer Interface Level?

What rules do you know about working at the Human-Computer Interface Level?

Human Computer InteractionThe quality of interaction between a user and the computer is governed by the standard of design (good or bad) of:

The various

input/output devices The software

interfacing with the user

Input and Output Devices5-minute buzz group activity 3

Turn to Exercise 1 (page 18) in the notes.

What are the inputs and outputs of the items named?

Diagram 2The Components Level

Main Memory Secondary Memory

Central Processing Unit

Input Device Output Device

User

What types of Input device are there?

What types of Input device are there?

What types of Output device are there?

What types of Output device are there?

ComponentsInteracting with the CPU

The quality of the interaction between the Input/Output devices and the CPU is the remit of the designer of the Operating System

What Operating Systems do you know?

Diagram 2The Components Level

Main Memory Secondary Memory

Central Processing Unit

Input Device Output Device

User

What types of Main Memory are there?

What types of Main Memory are there?

MemoryMemory is classified into: Random Access Memory (RAM) This is volatile, and information is lost when the

computer is switched off. There are two main types:

DRAM (cheap, slow) SRAM (faster, expensive)

Read –Only Memory (ROM) This retains information even when the computer

is switched off Main types are: PROM, EPROM, EEPROM, Flash

Diagram 2The Components Level

Main Memory Secondary Memory

Central Processing Unit

Input Device Output Device

User

What Sorts of Secondary Memory devices are there?

What Sorts of Secondary Memory devices are there?

Secondary Memory StorageInformation may be

stored on these types of devices: Floppy Disks Zip Disks Hard Drive Tape CD DVD etc.

Why is the hard drive “secondary” rather than “main” memory?

Why is the hard drive “secondary” rather than “main” memory?

Diagram 3The CPU Level

Central Processing Unit

Control Unit Registers

Arithmetic & Logic Unit

The Register Level

A register is a collection of “cells”.

A register is a collection of “cells”.

Each cell is a “flip-flop” electronic device which can be in one of two stable states.

Each cell is a “flip-flop” electronic device which can be in one of two stable states.

The Register LevelCells within the register can be held at high or low status.

Cells within the register can be held at high or low status.

This collection of cells now represents the Binary Number 11011001

This collection of cells now represents the Binary Number 11011001

The Register Level

Write

Read

Information comes in on 8 wires, using a write enable signal.

Information comes in on 8 wires, using a write enable signal.

Information is transferred (read) by using a similar read enable signal

Information is transferred (read) by using a similar read enable signal

Diagram 3The CPU Level

Central Processing Unit

Control Unit Registers

Arithmetic & Logic Unit

Interaction of components within the CPU The quality of the

operation of the CPU depends on the design and organisation at the digital electronics level.

These elements are etched onto the chip which supports the CPU

Diagram 4The ALU Level

Arithmetic & Logic Unit

Arithmetic Operations Logic Operations

Diagram 5The Logic Operation Level

Logic Operations

AND OR NOT COMPARE

Binary and Hexadecimal

Bytes The way that

information is coded is to use a sequence of zeros and ones

It is usual to have a sequence of 8 bits collected together

This is called a byte

10110101

Bits A bit is the smallest piece

of information in the computer

In a single cell, the digital information is either One - current is HIGH (ON) Zero -current is LOW (OFF)

There are no in-between states

ON

OFF

Bits and Bytes Depending upon the

design of the computer, there could be 4, 8 16, 32, 64 (or even more!) bits processed by the computer at once

For the next few slides we will look at a simple 4-bit device.

A 4-bit register Reading from the

right, each bit is worth double the one preceding it.

The sequence, reading from the right is: 1,2,4,8, ...

If we had more bits, it would continue: ... 16, 32, 64, etc.

148 2

4

is ON

1

is ON

Binary Numbers The register shown on

the right represents the binary number 0101

This has ones in the 1 and 4 cells, and zeroes in the others.

The number represented is 5

148 2

4 1

0101

4+1 = 5

Counting in Binary Follow the

sequence on the right, and try to continue it.

you will see that the switching creates a pattern of ON/OFF in each column

0001

0010

0011

0100

0101

0110

Decimal Numbers By decimal, we simply mean that

the numbers are written in powers of ten

These are 1, 10, 100, 1000, etc. So that:

352 = 300 + 50 + 2

100 10 1

3 5 2

Binary Numbers By Binary, we mean that numbers

are written in powers of two These are 1, 2, 4, 8, 16 etc. So that:

10100 = Which is 16 + 4 = 20

16 8 4 2 1

1 0 001

Converting Binary to Decimal Example: 101101 Reading from right to left the columns are

1,2,4,8 etc.

i.e. 32 16 8 4 2 11 0 1 1 0 1

So the number in decimal notation is:

32 + 8 + 4 + 1 = 45

How do we convert Decimal to Binary? There is a specific

technique which allows us to do this.

It involves repeatedly dividing a number by two and noting the remainder.

Converting Decimal to Binary:An example

Convert 117 to binary: 117÷ 2 = 58 remainder 1 58 ÷ 2 = 29 remainder 0 29 ÷ 2 = 14 remainder 1 14 ÷ 2 = 7 remainder 0 7 ÷ 2 = 3 remainder 1 3 ÷ 2 = 1 remainder 1 1 ÷ 2 = 0 remainder 1

In binary the number is: 1110101

Adding In Binary Addition in binary

is a direct counterpart of operations the processor level.

First of all we will look at a numerical example

Adding in Binary There are only four

possible combinations.

The first three are “obvious”

The last one is special (remember 1 + 1 = 2, which is 10 in binary)

0 + 0 = 0 0 + 1 = 1 1 + 0 = 1

1 + 1 = 0, carry 1

Adding in Binary The answer:

1 0 1 1 1 +1 1 1 0 1

1 1 0 1 0 0

1 1 1 1 1

1 + 1 = 10

i.e. two in binary

1 + 1 = 10

i.e. two in binary

1 + 1 + 1 = 11

i.e. three in binary

1 + 1 + 1 = 11

i.e. three in binary

Other Bases Decimal and Binary

are two different number bases used by the computer, but there are others

An important one is Hexadecimal which has 16 separate characters: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

The Hexadecimal System The Hexadecimal number System

had 16 separate characters: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

The extra letters are so that the numbers 10-15 can be written using one character each. This means that A7BC is a number written in Hexadecimal code

Hexadecimal These numbers are

written in base 16, so that a number like 9E means the 9 is 9 x 16 = 144 the E is 14 x 1 = 14

Altogether this would be 158

Dec Hex0 01 12 23 34 45 56 67 78 89 910 A11 B12 C13 D14 E15 F

Hexadecimal Numbers Normally in the context of computers,

we will only be considering two-digit Hexadecimal numbers like A3 or 4E

When the numbers have more digits we tend to split them up into two-digit pairs.

This makes interpretation a lot easier

Hexadecimal to Decimal

For example: The number 4E in Hexadecimal, is:

16 1

4 E

That is 4 x 16 = 64 and E (= 14) x 1 = 14 Total : 78 (Decimal Notation)

Converting Decimal to Hexadecimal Two-digit Hexadecimal numbers lie

in the range 0 – 255 We will only consider numbers in

this range. The answer will always be a two-

digit hexadecimal number

Converting Decimal to HexadecimalExample: Convert 181 to Hexadecimal

187 16 = 11 remainder 5

In Hexadecimal 11 = BIn Hexadecimal 5 = 5

This means:181 = B5Decimal Hexadecimal

Hexadecimal to Binary

The easiest way to convert Hex to Binary is by using a ‘look-up’ table to find the Binary equivalents for the Hex digits 0 to F

For example, the Binary for 6A would just be:

6 = 0110 A = 1010

6A = 0110 1010

Hex Binary0 00001 00012 00103 00114 01005 01016 01107 01118 10009 1001A 1010B 1011C 1100D 1101E 1110F 1111

Binary to Hexadecimal Converting Binary to Hex

can be done in exactly the same way, by using a look-up table

For example the binary number 10011011 will be:

1001 = 9 1011 = B

So that 10011011 = 9B

Binary Hex0000 00001 10010 20011 30100 40101 50110 60111 71000 81001 91010 A1011 B1100 C1101 D1110 E1111 F

Adding in Hexadecimal

289BC3 1

8 + B = 13

(i.e. nineteen written in hexadecimal)

8 + B = 13

(i.e. nineteen written in hexadecimal)

2 + 9 +1 = C

(i.e. twelve written in hexadecimal)

2 + 9 +1 = C

(i.e. twelve written in hexadecimal)

Activity

Now turn to Exercise 2 (page 18) and work through the examples on Binary and Hexadecimal