Thursday, September 29, 2011

4.16 High-Level Languages

  • Compiler - program that translate a complete high-level program to a machine language object program
  • High level languages usually produce programs that run more slowly and use more memory that machine or assembly language
  • High level languages are generally designed to process decimal numbers, and they are much less efficient than assembly language at handling bits
  • Machine and assembly language are better suited than high level languages for real time control applications because of their faster execution

4.14 Assembly Laungage

  • Programming language that allows the use of mnemonics in place of binary/hex  machine language
  • Assember - program that allows computer to convert assembly language to machine language
    • Full blown assembler - take a source code file that produce both object code file and list file
      • object code file contains the source code 
      • list file is a text file that contain source code instruction and any error messages found
    • One-line assembler - convert one line of source code at a time into machine language
  • Assembly language requires knowledge of
    • registers and instruction set of the MPU
    • address modes of the MPU
  • Assembly languages are not portable - program written for one type of MPU will generally not run on another MPU

4.13 Machine Language

  • The language of 0s and 1s
  • Only language that computer's circuitry understands
  • Lowest level programming language

4.10 The 68HC11 MPU - A Simplified Version

  • Buses
    • Three external buses and two internal buses
    • Three different buses type: 
      • address (16 bit, uni-direction)
      • data (8 bit, bi-direction)
      • control (groupings of all timing and control signals)
  • Registers - dedicated memory location inside MPU
    • Program counter  - 16-bit counter that controls the sequence in which the instructions are fetched from the memory (hold instruction addresses)
    • Data Address Register (DAR) - provides operand address to memory (hold data/operand address)
    • Instruction Register - holds the op code while the instruction decoder decodes it and signals the timing and control logic (TCL) to generate proper sequence of control signals (micro-program) to complete the execution of the indicated instruction
    • Accumulator and Data Register - hold the operands/data that the ALU operates on during the execution phase of an instruction
  • Timing and Control Logic 
    • Micro-program is built into MPU's TCL and control how MPU executes a machine language instruction; it cannot be modified by user. 

Wednesday, September 28, 2011

4.9 Instruction Words

  • A program consists of a sequence of binary-coded instructions that the CPU must fetch from memory, decode and execute
  • For most computers. instruction words convey two types of info:
    • the operation to be performed (op code)
    • the address of the operand (data) that is to be operated on (operand address)
  • Three basic 68HC11 instruction formats:
    • single byte (8 bit op code, no operand address)
    • two byte (8 bit op code, 8 bit operand address)
    • three byte (8 bit op code, low-order byte operand address, high-order byte operand address)
  • Exception: Instructions that use the Y register will have a prebyte precedes the op code byte (indicate internal Y register usage)
  • Some instructions will have 2-byte op code: a prebyte and the op code

4.6 Computer Words

  • Word is the fundamental unit of information in a computer
  • Computer treats each word as a single unit and stores each word in a specific memory location
  • Words stored in memory can represent several type of info:
    • binary numerical data
    • coded data
    • instruction codes
    • addresses that are part of an instruction

4.5 Microprocessors

  • Major differences among MPUs appear in word size, number & types of instructions, type of external control signals and memory.
  • Motorola MC68HC11 is a single-chip 8-bits microcontroller that contains an MPU, memory and I/O circuitry.