Basic Computer Concepts
1
 Central Processing Unit (CPU)
 Instruction Addressing
 CPU Architectures
2
 Registers
 Instruction Decoder
 Arithmetic Logic Unit (ALU)
 Example of operation
◦ Registers - Fetch instruction
◦ Instruction Decoder – Decode
instruction
◦ ALU - Execute instruction
◦ Registers - Go back to 1.
3
 Program counter (auto-increments)
 Instruction register
 Accumulator
 Flag register
 Stack pointer
 Index register
 General purpose registers
4
 Instruction - example: add a,b
◦ Directive (“add”)
◦ Source operand (“a”)
◦ Destination operand (“b”)
 Move memory to/from register
 Move register to/from register
 ALU operation to register
 ALU operation to memory
 Program flow control
5
 Add
 Subtract
 Multiply
 Divide
 Logic functions
6
 How are registers used in computer systems?
 What is the purpose of the program counter?
 What is the purpose of the instruction decoder?
 What does “ALU” stand for? What is its purpose?
 Compare and contrast the type of computer
language used versus the ease of generating code
and the control of timing.
 Which register of the CPU holds the address of the
instruction to be fetched?
 Which section of the CPU is responsible for
performing addition?
 What is the largest hex value that can be moved
into an 8-bit register? What is the decimal
equivalent of the hex value?
7
 1 clock cycle modes
◦ Inherent – no operand
◦ Indexed – operand address in register
 2 clock cycle modes
◦ Immediate – 8 bit constant follows
◦ Direct – 8 bit operand address follows
◦ Relative – 8 bit operand address offset follows
 3 clock cycle modes
◦ Immediate – 16 bit constant follows
◦ Extended – 16 bit operand address follows
8
 High level language
◦ lightCtr = 0; // reset the counter
◦ err = OS_ERR_Q_EMPTY;
 Assembly language
◦ LDAB #$12 ;load 12H into B
◦ LDAA source ;copy source to reg A.
 Machine language
9
 Can a microcontroller programmer
make up new addressing modes? Why
or why not?
 Compare and contrast the different
addressing modes available in most
microprocessors.
 True or false. HCS12 instructions using
extended addressing mode are 3-byte
/3-clock cycle instructions.
10
 von Neumann
◦ One data bus
◦ One address bus
 Harvard
◦ Two data busses
◦ Two address busses
 Direct Memory Access (DMA)
 Microcontroller (e.g. PIC795, HCS12)
◦ Harvard internally
◦ Von Neumann for add-ons
◦ Separate ports for I/O
◦ Sets of “shadow” registers
11
 High level versus assembly
 Instruction size
 Clock cycles per instruction
 Number of registers
 Register vs memory operations
12
 Compare and contrast the Harvard and von
Neumann architectures in terms of the use of
address and data busses to fetch code and data.
 Which architecture is most commonly used by
microcontrollers internally and why? Externally?
 What do RISC and CISC stand for? Compare and
contrast the size of instructions in each.
 Which of the following operations do not exist
for the ADD instruction in RISC?
(a) register to register
(b) immediate to register
(c) memory to memory
13
 Central Processing Unit (CPU)
 Instruction Addressing
 CPU Architectures
14

Ecet330 1 b - basic computer concepts

  • 1.
  • 2.
     Central ProcessingUnit (CPU)  Instruction Addressing  CPU Architectures 2
  • 3.
     Registers  InstructionDecoder  Arithmetic Logic Unit (ALU)  Example of operation ◦ Registers - Fetch instruction ◦ Instruction Decoder – Decode instruction ◦ ALU - Execute instruction ◦ Registers - Go back to 1. 3
  • 4.
     Program counter(auto-increments)  Instruction register  Accumulator  Flag register  Stack pointer  Index register  General purpose registers 4
  • 5.
     Instruction -example: add a,b ◦ Directive (“add”) ◦ Source operand (“a”) ◦ Destination operand (“b”)  Move memory to/from register  Move register to/from register  ALU operation to register  ALU operation to memory  Program flow control 5
  • 6.
     Add  Subtract Multiply  Divide  Logic functions 6
  • 7.
     How areregisters used in computer systems?  What is the purpose of the program counter?  What is the purpose of the instruction decoder?  What does “ALU” stand for? What is its purpose?  Compare and contrast the type of computer language used versus the ease of generating code and the control of timing.  Which register of the CPU holds the address of the instruction to be fetched?  Which section of the CPU is responsible for performing addition?  What is the largest hex value that can be moved into an 8-bit register? What is the decimal equivalent of the hex value? 7
  • 8.
     1 clockcycle modes ◦ Inherent – no operand ◦ Indexed – operand address in register  2 clock cycle modes ◦ Immediate – 8 bit constant follows ◦ Direct – 8 bit operand address follows ◦ Relative – 8 bit operand address offset follows  3 clock cycle modes ◦ Immediate – 16 bit constant follows ◦ Extended – 16 bit operand address follows 8
  • 9.
     High levellanguage ◦ lightCtr = 0; // reset the counter ◦ err = OS_ERR_Q_EMPTY;  Assembly language ◦ LDAB #$12 ;load 12H into B ◦ LDAA source ;copy source to reg A.  Machine language 9
  • 10.
     Can amicrocontroller programmer make up new addressing modes? Why or why not?  Compare and contrast the different addressing modes available in most microprocessors.  True or false. HCS12 instructions using extended addressing mode are 3-byte /3-clock cycle instructions. 10
  • 11.
     von Neumann ◦One data bus ◦ One address bus  Harvard ◦ Two data busses ◦ Two address busses  Direct Memory Access (DMA)  Microcontroller (e.g. PIC795, HCS12) ◦ Harvard internally ◦ Von Neumann for add-ons ◦ Separate ports for I/O ◦ Sets of “shadow” registers 11
  • 12.
     High levelversus assembly  Instruction size  Clock cycles per instruction  Number of registers  Register vs memory operations 12
  • 13.
     Compare andcontrast the Harvard and von Neumann architectures in terms of the use of address and data busses to fetch code and data.  Which architecture is most commonly used by microcontrollers internally and why? Externally?  What do RISC and CISC stand for? Compare and contrast the size of instructions in each.  Which of the following operations do not exist for the ADD instruction in RISC? (a) register to register (b) immediate to register (c) memory to memory 13
  • 14.
     Central ProcessingUnit (CPU)  Instruction Addressing  CPU Architectures 14