Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

38
Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie
  • date post

    15-Jan-2016
  • Category

    Documents

  • view

    220
  • download

    0

Transcript of Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

Page 1: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

Computer Systems

2009-2010

Week 8: 3-bit – The DisplayAmanda Oddie

Page 2: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

2

What we did last time STD 30 sends to printer LDD 31 gets data from keyboard We can load programs from hard

disc We can read a data file with LDD 29

Page 3: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

3

What we shall do today Mnemonics and binary The ASCII Character Set The 3-bit display Switching from pixel mode to

character mode

Page 4: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

4

Mnemonics So far all our instructions have been

written as Mnemonics. Mnemonics are easier for humans to

understand 3-bit is able to understand

mnemonics but real computers can only understand binary they need a special program called an

assembler to translate the mnemonics into binary

Page 5: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

5

MnemonicsMnemonic

Brief meaning

000 STP halt

001 LDD load accumulator direct

010 LDI load accumulator immediate

011 STD store accumulator direct

100 ADD add to accumulator

101 SUB subtract from accumulator

110 JMP jump to next instruction

111 JEZ jump to next instruction if contents of accumulator is zero

Page 6: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

6

A 3-bit instruction in binary 0 1 0 0 1 1 1 1 000 STP

001 LDD

010 LDI

011 STD

100 ADD

101 SUB

110 JMP

111 JEZop-code is 010. The

mnemonic is LDI

Page 7: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

7

A 3-bit instruction in binary 0 1 0 0 1 1 1 1 000 STP

001 LDD

010 LDI

011 STD

100 ADD

101 SUB

110 JMP

111 JEZ

This represents the number to be copied into the

accumulator. It is in the form of a binary number

Page 8: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

8

Decimal and Binary numbers 357 in decimal is interpreted as:

i.e. three(3) 100s and five (5) 10s and seven(7) units

100 10 1

3 5 7

Page 9: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

9

Decimal and Binary numbers 0 1 1 1 1 in binary is interpreted as:

i.e. zero 16s plus one 8 plus one 4

plus one 2 plus one unit = 15

128

64 32 16 8 4 2 1

0 1 1 1 1

Page 10: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

10

A simple program What will end up in the AC ?

010010100111010010010100011111101011010000000000

Remember: First 3 digits arethe OP-CODE, last 5 digits arethe OPERAND!

Try it on the exercise handout

Page 11: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

11

A simple program What will end up in the AC ?

010010100111010010010100011111101011010000000000

LDI 10STD 20ADD 20STD 30SUB 20STP

Much easier, that’s whymnemonics were developed

Accumulator ends up with

10

Page 12: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

12

Memory mapped locations Locations 18 – 25 are mapped

directly to the display device Location 26 is also connected to the

display device. It determines the screen mode

Page 13: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

13

Graphics hardware

•Data structure corresponding to the array of pixels in the monitor•Stored in main memory or video adapter

•Scans the frame buffer•Activates corresponding pixels on monitor

DisplayProgram

Page 14: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

14

Scanning the display Full screen scan

every 10 milliseconds

(Refresh rate)

Page 15: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

15

The Display A display is made up of an array of

dots that are either lit or unlit. The dots are called pixels, which is

derived from the phrase picture elements.

The image on the typical display is made up from at least tens of thousands of such pixels.

Page 16: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

16

The Display The closer together the pixels are,

the sharper the image on screen. The distance between pixels on a

computer monitor screen is called its dot pitch and is measured in millimeters.

Most monitors have a dot pitch of 0.28 mm or less.

Page 17: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

17

3-bit display The 3-bit display is made up of 64 dots

8 pixels across 8 lines down

Each line is at a separate memory address starting at location 18

A binary 1 will signify to light the pixel A binary 0 will not light the pixel

Page 18: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

18

A simple program What will

be displayed?

Page 19: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

19

Confused?Let’s convert the

decimal 255 to binary.

128 64 32 16 8 4 2 1

1 1 1 1 1 1 1 1

Page 20: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

20

A simple programLDD 10STD 18STD 19STD 20STD 21STD 22STD 23STD 24STD 25STP

Question: What will be displayed?

Memory Address10 contains the value 255

Page 21: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

21

Page 22: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

22

Character Mode Memory Address 26 is reserved for

display mode If the value in this address changes from

empty or 0 then the display will switch to character mode

Each memory address from 18 – 25 now represents one line of text with positions for 8 characters the first letter appears in location 18, the

second in location 19, the third in location 20 and so forth

Page 23: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

23

Character Mode Characters in computers are

represented by numbers The number is based on the ASCII

codes ASCII – American Standard Code

for Information Interchange

Page 24: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

24

ASCII Codes

‘A’ has ASCII Code 65

‘a’ has ASCII Code 65

Page 25: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

25

What happens here?0 LDI 11 STD 262 LDD 63 STD 184 STP56 65

Page 26: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

26

Outcome0 LDI 11 STD 262 LDD 63 STD 184 STP56 65

Page 27: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

27

What exactly happens? 1 is copied into the

accumulator 1 is copied from the

accumulator to location 26 this sets the display to character

mode 65 is copied from location 16

into the accumulator 65 is copied from the

accumulator to location 18 Location 18 is mapped to the

display unit which is now in character mode so it will display the character representation for 65 which is A

0 LDI 11 STD 262 LDD 63 STD 184 STP56 65

Page 28: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

28

A little more complex0 LDI 11 STD 262 LDD 93 STD 184 ADD 265 STD 196 ADD 267 STD 208 STP9 65

Page 29: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

29

A little more complexTry it on the

exercise sheet

Page 30: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

30

Outcome0 LDI 11 STD 262 LDD 93 STD 184 ADD 265 STD 196 ADD 267 STD 208 STP9 65

Page 31: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

31

What about now?0 LDI 11 STD 262 LDD 83 STD 184 SUB 265 JEZ 76 JMP 37 STP8 65

Page 32: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

32

Outcome after a number of iterations0 LDI 11 STD 262 LDD 83 STD 184 SUB 265 JEZ 76 JMP 37 STP8 65

Page 33: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

33

Final outcome0 LDI 11 STD 262 LDD 83 STD 184 SUB 265 JEZ 76 JMP 37 STP8 65

Page 34: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

34

Last Week Last week we looked at the hard

disk and data files Data files could contain numbers

that represent text Remember location 29 is mapped to

the disk buffer

Page 35: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

35

Question – What will be displayed?

Page 36: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

36

Next Week! The final lecture on 3-bit Focuses on 3-bit and networking

Network Status Network Data Frame Buffer Destination Address and so forth!

Page 37: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

37

3-bit is not so complicated?

Page 38: Computer Systems 2009-2010 Week 8: 3-bit – The Display Amanda Oddie.

38

Any Questions?