DELEXLC2 M5 - Zilog Microcontrollers AI

Cards (38)

  • The first general-purpose 4-bit single chip microprocessor, Intel 4004
    1971
  • Intel 8008, 8-bit microprocessor
    1972
  • An improved version of Intel 8008; used in the first "home computer"
    Intel 8080
  • Used in Apple II
    MOS Technologies 6502
  • Zilog Z80180 (Z80), an improved version of Intel 8080; Z8X180
    1978
  • Instruction register
    A small memory able to store 8 bits, or 1 byte of information. This information is an instruction for the microprocessor to carry out. The information is latched into the instruction register to release the internal data bus for other purposes. It doesn't do anything with the binary input
  • Instruction decoder
    • The part of the microprocessor that is able to actually carry out an instruction. Its first step is to identify which instruction that has been entered. It does this by comparing its binary code with an internally stored list. Once it has located the instruction it follows a built-in program called a microprogram
  • Microprogram
    A built-in program designed into the microprocessor by the manufacturer that details all the necessary steps to complete any instruction of which it is capable
  • When the Z80180 is given a job to do, it must be given an instruction. An instruction is in the form of an 8-bit binary number
  • Arithmetic and logic unit (ALU)
    • A simple pocket calculator. It can add, subtract, multiply, divide, and do various tricks with logic gates AND, OR, XOR etc. Compared with the average scientific calculator, it is pretty poor
  • Registers
    Small memories, of between 8 and 128 bits each, depending on the microprocessor being considered. In the Z80180, they are all 8 or 16 bits in size
  • Types of registers
    • General purpose registers
    • Special purpose registers
  • Main register set and alternate register set
    Identical except for the small 'prime' symbol. Having two sets allows the programmer to use the main set of registers while the prime registers can be loaded with other information ready for immediate use when required
  • Scenario using main and alternate register sets
    • Microprocessor is controlling a printing machine when the fire alarm is activated. It immediately abandons the printing program and starts to run the 'Fire Alarm' program, with information for the alarm program stored in the spare set of registers. When the alarm program is completed, it switches back to its main register set and continues the printing work
  • Accumulator
    A programmer can use it at any time to store an 8-bit binary number. It can also store numbers to be used in arithmetic operations or for logic operations like AND, OR etc. The results of such calculations are put back into the accumulator after completion
  • Flag register
    An 8-bit register where each bit stored is quite independent of all the others. A status register or flag register is like a window for us to see into the workings of the microprocessor. It allows communication between the microprocessor and the programmer
  • Flags in the flag register
    • Sign flag (S)
    • Zero flag (Z)
    • Add/subtract flag (N)
    • Carry flag (C)
    • Half-carry flag (H)
    • Parity/overflow flag (P/V)
  • Sign flag (S)
    A copy of bit 7 of the accumulator, indicating the sign of the number (negative if 1, positive if 0)
  • Zero flag (Z)
    Goes to 1 if the latest result is zero, 0 otherwise
  • Add/subtract flag (N)
    Indicates whether the last arithmetic instruction was 'add' (0) or 'subtract' (1)
  • Carry flag (C) and half-carry flag (H)
    Record the carry from bit 7 and bit 3 respectively during additions, and the borrow during subtractions
  • Parity/overflow flag (P/V)
    Used for two purposes: to check for overflow in arithmetic calculations, and to count the number of 1 bits in a byte (even = 1, odd = 0)
  • General-purpose registers
    1. bit registers that can be used two at a time as 16-bit registers, with restrictions on how they can be paired
  • H and L registers
    Used to store the high and low bytes of a 16-bit memory address
  • Program counter (PC)
    Keeps track of the address of the next instruction to be executed in a program
  • Stack pointer (SP)
    Points to the next address in a 'stack' of 16-bit memory locations, used for temporary storage of data
  • Index registers (X and Y)
    Their 16-bit contents can be added to the program counter to generate a new memory address, allowing for offsets and jumps in the program
  • Stack pointer (SP)

    The stack is generally used by the microprocessor to store data on a very temporary basis. We are allowed to use it but the microprocessor takes priority and doesn't know that we have been fiddling with it.
  • Index registers
    We have two index registers, one called X and the other called Y. They both perform the same function. The 16-bit content of the index register can be added to the contents of the program counter (PC) to produce a new address.
  • Using index registers
    Let's assume we are running a program which after using address 2600H we would like it to use some data stored in address 3800H. We could do this by loading the 16-bit number 1200H into the X register and instruct the microprocessor to go to the address written as PC + IX (program counter and index X). In this case, the microprocessor goes to address 2600H + 1200H = 3800H to retrieve the data to be used. This jump from 2600H to 3800H is called an offset or we may say that the index X register has provided an offset of 1200H.
  • Using index registers for user response
    The screen may show: "Enter number of copies". We could implement this by storing the response in one of the index registers and, as the printer performs each copy, the number stored is decreased by one (decremented) until it reaches zero. Every time that the counter is decremented, we instruct the microprocessor to check the state of the Z flag. When the count finally reaches zero, the Z flag will be set and the printer can be stopped.
  • R counter (R)

    This is a simple counter in which the lower seven bits are used to count the number of instructions that have been carried out by the microprocessor while it has been running the present program. It is reset to zero whenever the micro is restarted.
  • Data buffers
    The data buffer is an 8-bit register to store the information being provided by the external data bus. Once the buffer stores the binary information then tri-state buffers can lock-in the information disconnecting the external data bus so it can be used for carrying other data. This process is called 'latching'. As a general rule, all inputs to a chip from a bus are latched in.
  • Address and data buses
    The Z80180 has a (sort of)16-bit address bus and an 8-bit data bus. In this microprocessor there are two conflicting requirements: it has to remain compatible with the 16-bit address bus of the Z80 but we would like to be able to address 1 MB which requires 20 address lines. These requirements are met by the block shown as MMU or memory management unit.
  • Memory Management Unit (MMU)
    This circuit includes an 8-bit register that holds address information that can be controlled by the software being used. These 8 bits are combined with the top four address lines, A12–A15, of the address bus. The lower half of these 8 bits are added to the top 4 bits of the address bus and the upper 4 bits are used to expand the useable memory by adding the four extra address lines, A16–A19, to allow a total of twenty lines to be addressed.
  • Address buffers
    These are tri-state buffers just like the data buffers except they are one-way devices. The microprocessor sends addresses out along the address bus but no address information can come in this way.
  • Clock generator
    In this particular microprocessor the clock speed can be set to values between 6 MHz and 33 MHz. The clock signal originates from either a crystal or an external signal source – but never at the same time. Using an external signal can be useful where the microprocessor is used as part of a larger installation and this would allow the microprocessor timing to be governed by the surrounding circuitry. There are three nice things about increasing the frequency of a crystal: they get smaller, lighter and cheaper. The clock circuitry includes a divide-by-two circuit to allow the use of a double-frequency crystal with the above-mentioned benefits.
  • Interrupts
    Our microprocessor-based system controlling the printer while all around the office was burning. It stopped its main program and went off to phone the fire services, alert the maintenance staff, activate sprinklers etc. Fire is not the only hazard our little friend can safeguard us from. It could warn for other things like the paper running out in the printer or data corruption on the telephone cable.