Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations.

Similar presentations


Presentation on theme: "Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations."— Presentation transcript:

1 Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations

2 Updating the Paper Tape Approach The paper tape programming method has a number of disadvantages Not very quick or compact Can’t randomly access (i.e. no jumps, loops etc.) Requires a lot of bits of storage Solid state program memory (a big bank of read-only registers) solves the first two problems The last requires the introduction of operation codes (op-codes)

3 Operation Codes Useful operations A  B B  A A  C C  A B  C C  B Only 6, could be coded into just 3 bits A I/O CLK R/W B I/O CLK R/W 8 C I/O CLK R/W System Bus Control Unit Op-Code

4 Op-Codes The paper tape program can recreate absolutely any permutation of control signals, ALU inputs etc. Many permutations are either not permitted or are just not very useful, so only a restricted set of possible data transfers are allowed. This means that instructions can be coded into much shorter words, or op-codes (12 bits for PICs) It does, however, require an extra block of logic to decode the op-codes.

5 Machine Code & Assembly Language A sequence of op-codes forms a program It is just a list of numbers though, ideal for the processor – not so easy for humans A program in this form is written in machine code Each op-code has a mnemonic equivalent (e.g. ADD, SUB, OR etc.) A program written in such mnemonics can be converted to machine code using an assembler It is, therefore, known as assembly language

6 Examples For the Z80 processor: Assembly Language Machine Code SUB B10010000 OR C10110001 LD D,E01010011

7 Using Program Memory WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Control Unit Instruction Register Program Memory Program Counter

8 Using Program Memory WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Control Unit Instruction Register Program Memory Program Counter Program Counter, PC Stores the position (or address) in program memory of the next instruction. It is automatically incremented after each operation.

9 Using Program Memory WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Control Unit Instruction Register Program Memory Program Counter Program Memory A block of programmable read-only memory (ROM) containing a list of op-codes, i.e. a program.

10 Using Program Memory WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Control Unit Instruction Register Program Memory Program Counter Instruction Register A special register whose only purpose is to temporarily store the op-code of the instruction currently being executed.

11 Using Program Memory WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Control Unit Instruction Register Program Memory Program Counter Control Unit A block of logic that translates the op-code into the corresponding ALU select inputs and the control signals to the registers.

12 More on the Program Counter The Program Counter is a special purpose register used to address program memory. After each instruction, its contents are incremented by one. It can also be written to using the system bus, allowing the processor to ‘jump’ to any address in program memory. Its contents can also be temporarily stored on a stack allowing easy implementation of sub-routines.

13 A Micro-Controller

14 The Status Register (SR) The ALU produces a variety of flags after most operations, the most important are: Carry Flag Zero Flag The states of these flags are stored in the status register, SR. This register can be read like any other. More usefully, some operations (usually jumps) can be conditional on the state of one or more flags. Using these op-codes, ‘if-then’ operations, ‘for’ loops etc. are possible.

15 Input/Output Registers Input/Output (I/O) registers behave just like general purpose ones… … except that I/O registers can be written to or read from externally via the pins of the chip housing the micro-controller. These registers are vital, they’re the only way the device can communicate and do something useful.

16 Programming Micro-controller op-codes represent very simple operations: Data transfers Arithmetic or logical operations Flow of control Even the most elaborate of tasks can be broken down into a sequence of these primitive operations. Breaking down jobs in such an elemental way is what programming is all about.

17 Part One of EE1A2 Number Systems You should be able to: Convert numbers between decimal, hex and binary forms Perform binary arithmetic operations Binary Arithmetic Circuits Adder, carry look-ahead Addition/Subtraction Circuit ALUs Design of basic logic devices capable of a several binary arithmetic and/or logical operations.

18 Part One of EE1A2 (cont) Registers Memory elements storing one byte of data. Interconnection using tri-state ports connected to a common bus. Control signals necessary to transfer data. Micro-controllers All the basic components required to make a computer integrated onto a single chip. The ALU, registers, program memory and input/output circuitry – what they all do. Programming using assembly language - welcome to the rest of the course !


Download ppt "Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations."

Similar presentations


Ads by Google