1 / 38

Computer Systems 2009-2010

Computer Systems 2009-2010. Week 8: 3-bit – The Display Amanda Oddie. 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. What we shall do today. Mnemonics and binary

malo
Download Presentation

Computer Systems 2009-2010

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Systems2009-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

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

  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

  5. Mnemonics

  6. op-code is 010. The mnemonic is LDI A 3-bit instruction in binary 0 1 0 0 1 1 1 1

  7. A 3-bit instruction in binary 0 1 0 0 1 1 1 1 This represents the number to be copied into the accumulator. It is in the form of a binary number

  8. Decimal and Binary numbers • 357 in decimal is interpreted as: • i.e. three(3) 100s and five (5) 10s and seven(7) units

  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

  10. A simple program • What will end up in the AC ? 01001010 01110100 10010100 01111110 10110100 00000000 Remember: First 3 digits are the OP-CODE, last 5 digits are the OPERAND! Try it on the exercise handout

  11. A simple program • What will end up in the AC ? 01001010 01110100 10010100 01111110 10110100 00000000 Much easier, that’s why mnemonics were developed LDI 10 STD 20 ADD 20 STD 30 SUB 20 STP Accumulator ends up with 10

  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

  13. 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 Graphics hardware Program Display

  14. Scanning the display • Full screen scan every 10 milliseconds • (Refresh rate)

  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.

  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.

  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

  18. A simple program • What will be displayed?

  19. Confused? Let’s convert the decimal 255 to binary.

  20. A simple program LDD 10 STD 18 STD 19 STD 20 STD 21 STD 22 STD 23 STD 24 STD 25 STP Question: What will be displayed? Memory Address 10 contains the value 255

  21. 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

  22. Character Mode • Characters in computers are represented by numbers • The number is based on the ASCII codes • ASCII – American Standard Code for Information Interchange

  23. ‘A’ has ASCII Code 65 ‘a’ has ASCII Code 65 ASCII Codes

  24. What happens here? 0 LDI 1 1 STD 26 2 LDD 6 3 STD 18 4 STP 5 6 65

  25. Outcome 0 LDI 1 1 STD 26 2 LDD 6 3 STD 18 4 STP 5 6 65

  26. 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 1 1 STD 26 2 LDD 6 3 STD 18 4 STP 5 6 65

  27. A little more complex 0 LDI 1 1 STD 26 2 LDD 9 3 STD 18 4 ADD 26 5 STD 19 6 ADD 26 7 STD 20 8 STP 9 65

  28. A little more complex Try it on the exercise sheet

  29. Outcome 0 LDI 1 1 STD 26 2 LDD 9 3 STD 18 4 ADD 26 5 STD 19 6 ADD 26 7 STD 20 8 STP 9 65

  30. What about now? 0 LDI 1 1 STD 26 2 LDD 8 3 STD 18 4 SUB 26 5 JEZ 7 6 JMP 3 7 STP 8 65

  31. Outcome after a number of iterations 0 LDI 1 1 STD 26 2 LDD 8 3 STD 18 4 SUB 26 5 JEZ 7 6 JMP 3 7 STP 8 65

  32. Final outcome 0 LDI 1 1 STD 26 2 LDD 8 3 STD 18 4 SUB 26 5 JEZ 7 6 JMP 3 7 STP 8 65

  33. 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

  34. Question – What will be displayed?

  35. 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!

  36. 3-bit is not so complicated?

  37. Any Questions?

More Related