Ch05 Advanced Processors
Ch05 Advanced Processors
2
❑ A complex instruction set computer
(CISC, pronounced like "sisk") is a
microprocessor instruction set
architecture (ISA) in which each
instruction can execute several low-
level operations, such as a load from
memory, an arithmetic operation, and a
memory store, all in a single instruction. 3
❑ The philosophy behind it is, that
hardware is always faster than software,
therefore one should make a powerful
instruction set, which provides
programmers with assembly instructions
to do a lot with short programs.
❑ So the primary goal of the Cisc is to
complete a task in few lines of assembly
instruction as possible. 4
❑ Memory in those days was expensive
✓ bigger program->more storage->more money
Hence needed to reduce the number of instructions
per program
❑ Number of instructions are reduced by having
multiple operations
within a single instruction
❑ Multiple operations lead to many different kinds of
instructions that
access memory
✓ In turn making instruction length variable and
fetch-decodeexecute
time unpredictable – making it more complex 5
✓ Thus hardware handles the complexity
➢ Use microcode
• Used a simplified microcode instruction set to control
the data path logic. This type of implementation is known
as a microprogrammed implementation.
➢ Build rich instruction sets
• Consequences of using a microprogrammed design is
that designers could build more functionality into each
instruction.
➢ Build high-level instruction sets
• The logical next step was to build instruction sets
which map directly from high-level languages 6
❑ Register to register, register to
memory, and memory to register
commands.
❑ Uses Multiple addressing modes .
❑ Variable length instructions where
the length often varies according
to the addressing mode
❑ Instructions which require
multiple clock cycles to execute.
7
Main memory
Registers: A,B,C,D,E,F
9
For this particular task, a CISC
➢ processor would come prepared with a specific instruction (we'll call it
"MULT").
MULT A,B
When executed, this instruction
➢ loads the two values into separate registers,
➢ multiplies the operands in the execution unit, and then
➢ stores the product in the appropriate register.
Thus, the entire task of multiplying two numbers can be completed with
one instruction
➢ MULT is what is known as a "complex instruction."
➢ It operates directly on the computer's memory banks and does not
require the programmer to explicitly call any loading or storing
functions.
➢ It closely resembles a command in a higher level language,identical to
12
! The following equation is commonly used for cisc
expressing a computer's performance ability:
Risc
The CISC approach attempts to minimize the
number of instructions per program, sacrificing
the number of cycles per instruction.
RISC does the opposite, reducing the cycles per
instruction at the cost of the number of
instructions per program.
13
❑ There is still considerable controversy
among experts about which architecture is
better.
Some say that RISC is cheaper and
faster and therefore the architecture of the
future.
Others note that by making the
hardware simpler, RISC puts a greater
burden on the software. Software needs to
become more complex. Software developers
need to write more lines for the same tasks. 14
INTRODUCTION
■ What is PIC?
- A family of Harvard architecture
microcontrollers made by Microchip Technology
17
TWO DIFFERENT ARCHITECTURES
18
RISC VS. CISC
19
FAMILY CORE ARCHITECTURE
DIFFERENCES
20
THE PIC FAMILY: SPEED
■ Can use crystals, clock oscillators, or even an RC
circuit.
■ Some PICs have a built in 4MHz RC clock, Not very
accurate, but requires no external components!
■ Instruction speed = 1/4 clock speed (Tcyc = 4 * Tclk)
■ All PICs can be run from DC to their maximum
specified speed:
12C50x 4MHz
12C67x 10MHz
16Cxxx 20MHz
17C4x / 17C7xxx 33MHz 21
18Cxxx 40MHz
CLOCK AND INSTRUCTION CYCLES
■ Instruction Clock
● Clock from the oscillator enters a microcontroller via OSC1 pin where internal
circuit of a microcontroller divides the clock into four even clocks Q1, Q2, Q3, and
Q4 which do not overlap.
● These four clocks make up one instruction cycle (also called machine cycle)
during which one instruction is executed.
● Execution of instruction starts by calling an instruction that is next in string.
● Instruction is called from program memory on every Q1 and is written in
instruction register on Q4.
● Decoding and execution of instruction are done between the next Q1 and Q4
cycles. On the following diagram we can see the relationship between instruction
cycle and clock of the oscillator (OSC1) as well as that of internal clocks Q1-Q4.
● Program counter (PC) holds information about the address of the next
instruction.
22
PIPELINING IN PIC
■ Instruction Pipeline Flow
23
THE PIC FAMILY: PROGRAM MEMORY
■ Technology: EPROM, FLASH, or ROM
■ It varies in size from one chip to another.
- examples:
12C508 512 12bit
instructions
16C711 (1k) 1024 14bit
instructions
16F877 (8k) 8192 14bit
instructions
17C766 (16k) 16384 16bit 24
instructions
THE PIC FAMILY: DATA MEMORY
■ PICs use general purpose “File registers” for
RAM (each register is 8bits for all PICs)
- examples:
25
PIC PROGRAMMING PROCEDURE
■ For example: in programming an embedded PIC featuring
electronically erasable programmable read-only memory
(EEPROM). The essential steps are:
● Step 3: Insert your PIC into your circuit, power up and verify
the program works as expected. This step is often called
"dropping" the chip. If it isn't, you must go to Step 1 and
debug your program and repeat burning and dropping.
26
PIC16F877A FEATURES
High Performance RISC CPU:
■ Only 35 single word instructions to learn
27
REFERENCES AND FURTHER
READINGS
■ http://www.microchip.com
■ http://en.wikipedia.org/wiki/
PIC_microcontroller