SlideShare ist ein Scribd-Unternehmen logo
1 von 38
1
Digital Systems and Microprocessor Design
(H7068)
Daniel Roggen
d.roggen@sussex.ac.uk
8.1. Intro to UoS
educational
processor
2
UoS Educational Processor
• Developed in 2014 for "Digital Systems and Microprocessor Design"
at University of Sussex by Daniel Roggen
• License: LGPL 2.1
• https://github.com/droggen/uos_educational_processor.git
• https://opencores.org/project,uos_processor
3
General processor
• Instruction and data memory outside of processor
– One reason: different semiconductor technologies
– Higher densities with dedicated chips
program counter
4
What's next: Educational Processor
• 8-bit, 4 register processor, Von Neumann architecture
• 3 clock cycle per instruction
• 16-bit instruction set (inspired by x86 ISA)
– Direct, indirect, immediate, register addressing
• Customizable instructions
• External memory bus (for program/data)
• I/O interface (as in microcontrollers)
• Implemented in VHDL
• Synthesizable
5
6
Educational processor overview
• Control unit: loads the instruction from memory and controls its execution
– Memory interface: whether to read or write memory (we: write enable), where to read
(address), the data to write (datawr) and gets the data from memory with datard
– External interface: whether to write or read
– The ALU operation
– The input to the register bank
– The input to the ALU
7
Educational processor overview
• Register bank: 4 8-bit registers RA,RB,RC,RD
– Provides two outputs from any two registers (asynchronous output). Registers to read from
are specified by control lines.
– Allows to synchronously write to one register. Register to write to, and whether to write, is
controlled by control lines.
– Registers (to read or write) are identified by a 2-bit code: RA=00, RB=01, RC=10, RD=11
8
Educational processor overview
• Register bank input: select data written to the register bank (if a write occurs
in the register bank)
• Data to register bank can come from: ALU output, memory interface, external
interface, another register, or the instruction
9
Educational processor overview
• ALU input: select data fed to ALU
• ALU input data can come from the register bank or from the instruction
10
Educational processor overview
• The ALU takes two inputs and performs a logical or arithmetic operation
defined according to the control line
11
Educational processor overview
• The external interface allows to read or write data from a parallel interface on the
processor
• This is commonly used in microcontrollers to connect peripherals (LEDs, buttons)
• During a write the interface stores the value to put on ext_out (D FF).
• No special operation during read, however more advanced external interfaces could
perform signal conditioning (e.g. debouncing)
12
Educational processor overview
• The memory interface allows to connect to an external memory
• In this educational processor the memory interface is transparent (no special function).
• More advanced processors may have special interfaces to read from DRAM, SRAM,
SD cards, etc.
13
Educational processor overview
• Processor ports: memory interface, exernal interface, clock and reset
• Reset is synchronous! (occurs on the rising edge of clock)
• More advanced processors may have several memory and external
interfaces, additional pins to generate "interrupts" (branch of the
execution flow when a pin is toggled), etc.
14
Educational processor on FPGA
• The processor is synthesized on the FPGA as any other component
with the entity port map syntax.
• A 32 bytes memory is synthesized alongsize the processor for
program and data. It has 32 entries (5 bit address) of 8 bits
• Push buttons allow to generate single clocks to test the processor
• LED and switches connected to external interface
Memory
From switches
To LEDsPush button
15
Stored program (von Neumann)
• Instructions represented as number in memory
• Programs are just like data
• However:
– Program goes to the control unit
– Data goes to the data path
16
Instruction
• An instruction defines the operation of the processor
when it is executed
• An instruction is defined by it's bit-width and whether it is
fixed-length or variable length
– Fixed length lead to easier implementation but use more
memory
– Variable length can optimize the size for frequent instruction
• It comprises multiple fields: opcode (operation code),
source, destination, etc.
• Different processor architectures have different
instruction sets with their own encoding
17
Instructions in the educational CPU
• All instructions are 16-bit wide (fixed size)
• 3-bit opcode (operation code): indicates the type of
operation
• The meaning of the remaining bits depends on the
opcode!
instr(15..13) instruction(12..8) instruction(7..0)
Opcode depends on the
instruction
src
18
Program counter / Instruction pointer
• PC or IP: register in the processor control unit that
indicates the memory location where the instruction is
fetched
• PC starts at zero on reset
• As instructions are 16 bits, the first instruction is at
memory location 00 and 01; the second instruction at
memory location 02 and 03;...
• PC incremented continuously for usual instructions
• Except with "jump" instructions: the PC changed to fetch
instruction from another location
19
Encoding v.s. "assembler" instruction
• All instructions are 16-bit data stored in memory
• The instructions can be specified by their binary code:
– 1000001010101
• Or to simplify reading by their hex code:
– 1055h
• To further simplify reading we use a human readable
format:
– mov ra,55h
• We refer to this format as an "assembler" instruction
because a software (or human) would read the text "mov
ra,55h" and "assemble" the various parts of the
encoding to obtain 1055h
20
Opcodes
• Defines the "category" of the instruction
• 3-bit opcode: total of 8 "categories" of instructions
• Defined in order to help the decoding of the instruction.
• All instructions of the same opcode share the same encoding
• Opcode 000: move instructions
• Opcode 001: ALU instructions
• Opcode 010: ALU instructions
• Opcode 011: ALU instructions
• Opcode 100: unused
• Opcode 100: ALU instructions
• Opcode 101: jump instructions
• Opcode 110: external interface instructions
• Opcode 111: unused
21
Move instructions (opcode 000)
• Moves data between registers, immediate and memory
• mov dst,src
– moves the data specified by source into destination
Instructions instruction(15..8) Instruction(7..0)
Move Opcode dd#m sd#m dreg src
mov r, r 0 0 0 0 0 0 r r - - - - - - r r
mov r, i 0 0 0 1 0 0 r r i i i i i i i i
mov r, [r] 0 0 0 0 0 1 r r - - - - - - r r
mov r, [i] 0 0 0 1 0 1 r r i i i i i i i i
mov [r], r 0 0 0 0 1 0 r r - - - - - - r r
mov [r], i 0 0 0 1 1 0 r r i i i i i i i i
IR /
22
immediate/register
• the src field contains the "source" data for the instruction
(sometimes unused)
• Source can be immediate or register depending on R'/I
• R’/I=1: src is an immediate: the 8 LSBs in the instruction
are used as the data
• R’/I=0: src is a register: the data comes from a register.
The register is specified by the 2 least significant bits in
src
– RA: 00
– RB: 01
– RC: 10
– RD: 11
Instructions instruction(15..8) Instruction(7..0)
Move Opcode dd#m sd#m dreg srcIR /
23
direct/indirect
• Source: direct or memory mode specified by sd#m
• Direct mode: the value of a register or immediate is moved to dst
• Memory mode: the instruction fetch the data from the memory
location specified by src (which can be immediate or register)
• Syntax: use brackets around src to indicate memory mode
– mov ra,[55h]
Instructions instruction(15..8) Instruction(7..0)
Move Opcode dd#m sd#m dreg srcIR /
24
destination
• Destination is always a register (direct) or a memory location
(memory mode) specified by a register, depending on dd#m
• Direct mode: the value of source is moved to a register
• Memory mode: the instruction will fetch the data from a memory
location.
• Syntax: use brackets around dst to indicate memory mode
– mov [ra],55h
Instructions instruction(15..8) Instruction(7..0)
Move Opcode dd#m sd#m dreg srcIR /
25
Move examples
• mov ra,rb:
– src is direct, register: moves the content of reg b into reg a
– dst is direct register
• mov ra,13h:
– src is direct, immediate: moves 13h into reg a
– dst is direct register
• mov ra,[rb]
– src is memory, register: moves the data at the memory location b into a
– dst is direct register
• mov ra,[13h]:
– src is memory, immediate: moves the data at the memory location 13h
into a
– dst is direct register
• mov [ra],rb:
– src is register:
– dst is memory: moves the content of reg b into reg a
26
ALU (opcodes 001,010,011)
• Performs an arithmetic/logic operation on one or two
operands
• instr dst, src
– Performs a two operand operation on dst and src and puts the
result in dst
• instr dst
– Performs a single operand operation on dst and puts the result
in dst
• dst is always a register
• src is a register or an immediate
27
ALU: two operands
• ALU op indicates which ALU operation
• src: source (immediate/register according to R'/I)
• dst: destination
Instructions instruction(15..8) Instruction(7..0)
ALU 2 op opcode ALU op dreg src
add r, r 0 0 1 0 0 0 r r - - - - - - r r
add r, i 0 0 1 1 0 0 r r i i i i i i i i
sub r, r 0 0 1 0 0 1 r r - - - - - - r r
sub r, i 0 0 1 1 0 1 r r i i i i i i i i
and r, r 0 0 1 0 1 0 r r - - - - - - r r
and r, i 0 0 1 1 1 0 r r i i i i i i i i
or r, r 0 0 1 0 1 1 r r - - - - - - r r
or r, i 0 0 1 1 1 1 r r i i i i i i i i
xor r, r 0 1 0 0 0 0 r r - - - - - - r r
xor r, i 0 1 0 1 0 0 r r i i i i i i i i
IR /
28
Examples
• add RA,RB
– Stores RA+RB in RA
• sub RA,03h
– stores RA-3 in RA.
• and RD,55h
– stores the logical AND of RD and 55h in RD
Always indicate numbers by a 2 digit with an h at the end for hex!
Avoids confusion between register RA and value Ah
29
ALU: comparison
• Comparison: cmp dst,src
• src: source (immediate/register according to R'/I)
• dst: destination
• Comparison is performed by subtracting src from dst!
• Result of the comparison is stored in flags: carry and
zero
– Zero=1 Carry=0: dst=src
– Zero=0 Carry=0: dst>src
– Zero=0 Carry=1: dst<src
• Result of comparison used by conditional jump
Test opco
de
ALU op dr
eg
immedite /
reg
cmp r, r 0 1 0 0 0 1 r r - - - - - - r r
cmp r, i 0 1 0 1 0 1 r r i i i i i i i i
IR /
30
ALU: one operand
• Format: instr dst
• The operation is applied on dst and the result is in dst
• Example:
– not ra
– asr rb
Instructions instruction(15..8) Instruction(7..0)
ALU 1 op opcode ALU op dreg
not r 0 1 1 0 0 0 r r - - - - - - - -
shr r 0 1 1 0 0 1 r r - - - - - - - -
ror r 0 1 1 0 1 0 r r - - - - - - - -
asr r 0 1 1 0 1 1 r r - - - - - - - -
rol r 0 1 1 1 0 0 r r - - - - - - - -
31
Jumps (opcode 101)
• Unconditional jumps: changes the value of PC to
destination
– jmp dst
• Conditional jumps: changes the value of PC if a condition
is met. Condition is tested by checking the flags (carry,
zero). Flags are set by a prior comparison
• JA: jump if above
– Jumps if Zero=0 and Carry=0
• JB: jump if below
– Jumps if Zero=0 and Carry=1
• JE: jump if equal
– Jumps if Zero=1
32
Compare / jump examples
Carry Zero
mov ra,0Ah 0 0
cmp ra,09h 0 0
cmp ra,0Ah 0 1
cmp ra,0Bh 1 0
33
Compare / jump examples
Carry Zero
mov ra,0Ah 0 0
cmp ra,09h 0 0
jb dst1 -- not taken: RA not below 9h
je dst2 -- not taken: RA not equal 9h
ja dst3 -- taken: RA above 9h
34
Compare / jump examples
Carry Zero
mov ra,0Ah 0 0
cmp ra,0Ah 0 1
jb dst1 -- not taken: RA not below Ah
je dst2 -- taken: RA not equal Ah
ja dst3 -- not taken: RA not above Ah
35
Compare / jump examples
Carry Zero
mov ra,0Ah 0 0
cmp ra,0Bh 1 0
jb dst1 -- taken: RA below Bh
je dst2 -- not taken: RA not equal Bh
ja dst3 -- not taken: RA above Bh
36
External interface (opcode 110)
• Out: write register or immediate to the external interface
• In: read data from the external interface into a register
Instructions instruction(15..8) Instruction(7..0)
IO opcode IO type dreg src
out r 1 1 0 0 0 0 - - - - - - - - r r
out i 1 1 0 1 0 0 - - i i i i i i i i
in r 1 1 0 - 0 1 r r - - - - - - - -
IR /
37
Instruction fetch and execution
• Instructions are 16 bit but memory is 8 bit!
• Two cycles needed to fetch the instruction
• One cycle for execution
• Consequence: 3 clock cycles per instruction
38
Summary
• The architecture and features of the processor are clear
at a high level
• The characteristics of the instruction set are understood:
– Instruction execution time
– Instruction encoding
– Instruction set (move, alu, jump, external) and its characteristics
(register/immediate, direct/memory)

Weitere ähnliche Inhalte

Was ist angesagt?

Prerequriment of microcontroller
Prerequriment of microcontrollerPrerequriment of microcontroller
Prerequriment of microcontrollerKshitij Wagle
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051hello_priti
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 MicrocontrollerJai Sudhan
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessorvenkateshkannat
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkarSAQUIB AHMAD
 
Clock-8086 bus cycle
Clock-8086 bus cycleClock-8086 bus cycle
Clock-8086 bus cycleRani Rahul
 
Basic computer organisation design
Basic computer organisation designBasic computer organisation design
Basic computer organisation designSanjeev Patel
 
Microprocessors-based systems (under graduate course) Lecture 2 of 9
Microprocessors-based systems (under graduate course) Lecture 2 of 9 Microprocessors-based systems (under graduate course) Lecture 2 of 9
Microprocessors-based systems (under graduate course) Lecture 2 of 9 Randa Elanwar
 
Computer instruction
Computer instructionComputer instruction
Computer instructionSanjeev Patel
 
Computer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notesComputer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notesLakshmi Sarvani Videla
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacingRAMPRAKASHT1
 
8085 microproceesor ppt
8085 microproceesor ppt8085 microproceesor ppt
8085 microproceesor pptRJ Aniket
 
Embedded systems ppt ii
Embedded systems ppt iiEmbedded systems ppt ii
Embedded systems ppt iianishgoel
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorRavi Anand
 
Introduction to 8085 Microprocessors
Introduction to 8085 MicroprocessorsIntroduction to 8085 Microprocessors
Introduction to 8085 MicroprocessorsVeerakumar S
 

Was ist angesagt? (20)

Microprocessor history1
Microprocessor history1Microprocessor history1
Microprocessor history1
 
Prerequriment of microcontroller
Prerequriment of microcontrollerPrerequriment of microcontroller
Prerequriment of microcontroller
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
8051 Microcontroller
8051 Microcontroller8051 Microcontroller
8051 Microcontroller
 
Blackfin core architecture
Blackfin core architectureBlackfin core architecture
Blackfin core architecture
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessor
 
8085 microprocessor ramesh gaonkar
8085 microprocessor   ramesh gaonkar8085 microprocessor   ramesh gaonkar
8085 microprocessor ramesh gaonkar
 
8051 block diagram
8051 block diagram8051 block diagram
8051 block diagram
 
Clock-8086 bus cycle
Clock-8086 bus cycleClock-8086 bus cycle
Clock-8086 bus cycle
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
Basic computer organisation design
Basic computer organisation designBasic computer organisation design
Basic computer organisation design
 
Microprocessors-based systems (under graduate course) Lecture 2 of 9
Microprocessors-based systems (under graduate course) Lecture 2 of 9 Microprocessors-based systems (under graduate course) Lecture 2 of 9
Microprocessors-based systems (under graduate course) Lecture 2 of 9
 
Computer instruction
Computer instructionComputer instruction
Computer instruction
 
Computer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notesComputer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notes
 
Peripherals and interfacing
Peripherals  and interfacingPeripherals  and interfacing
Peripherals and interfacing
 
Introduction to 8085svv
Introduction to 8085svvIntroduction to 8085svv
Introduction to 8085svv
 
8085 microproceesor ppt
8085 microproceesor ppt8085 microproceesor ppt
8085 microproceesor ppt
 
Embedded systems ppt ii
Embedded systems ppt iiEmbedded systems ppt ii
Embedded systems ppt ii
 
Introduction to 8085 Microprocessor
Introduction to 8085 MicroprocessorIntroduction to 8085 Microprocessor
Introduction to 8085 Microprocessor
 
Introduction to 8085 Microprocessors
Introduction to 8085 MicroprocessorsIntroduction to 8085 Microprocessors
Introduction to 8085 Microprocessors
 

Ähnlich wie W8_1: Intro to UoS Educational Processor

UNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsUNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsButtaRajasekhar2
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationAmrutaMehata
 
Module -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxModule -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxDrVaibhavMeshram
 
Introduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationIntroduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationDr. Balaji Ganesh Rajagopal
 
introduction to embedded systems part 1
introduction to embedded systems part 1introduction to embedded systems part 1
introduction to embedded systems part 1Hatem Abd El-Salam
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...Rai University
 
Arm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberArm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberasodariyabhavesh
 
ICT-Lecture_12(VonNeumannArchitecture).pptx
ICT-Lecture_12(VonNeumannArchitecture).pptxICT-Lecture_12(VonNeumannArchitecture).pptx
ICT-Lecture_12(VonNeumannArchitecture).pptxSirRafiLectures
 
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptxlec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptxMadavanR1
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systemscmkandemir
 
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...Rai University
 
8085 Microprocessor Architecture
8085 Microprocessor Architecture8085 Microprocessor Architecture
8085 Microprocessor Architecturedeval patel
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Rai University
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Subhasis Dash
 
Computer Organization and Architechuture basics
Computer Organization and Architechuture basicsComputer Organization and Architechuture basics
Computer Organization and Architechuture basicsLucky Sithole
 

Ähnlich wie W8_1: Intro to UoS Educational Processor (20)

UNIT 3 - General Purpose Processors
UNIT 3 - General Purpose ProcessorsUNIT 3 - General Purpose Processors
UNIT 3 - General Purpose Processors
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
 
Module -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxModule -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptx
 
Unit 2.ppt
Unit 2.pptUnit 2.ppt
Unit 2.ppt
 
W8: Laboratory 1
W8: Laboratory 1W8: Laboratory 1
W8: Laboratory 1
 
Introduction to Computer Architecture and Organization
Introduction to Computer Architecture and OrganizationIntroduction to Computer Architecture and Organization
Introduction to Computer Architecture and Organization
 
introduction to embedded systems part 1
introduction to embedded systems part 1introduction to embedded systems part 1
introduction to embedded systems part 1
 
MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...MCA-I-COA- overview of register transfer, micro operations and basic computer...
MCA-I-COA- overview of register transfer, micro operations and basic computer...
 
Arm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furberArm architecture chapter2_steve_furber
Arm architecture chapter2_steve_furber
 
ICT-Lecture_12(VonNeumannArchitecture).pptx
ICT-Lecture_12(VonNeumannArchitecture).pptxICT-Lecture_12(VonNeumannArchitecture).pptx
ICT-Lecture_12(VonNeumannArchitecture).pptx
 
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptxlec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
lec3-8051microcontrollerarchitecture-230130044236-5c11a082.pptx
 
CAO.pptx
CAO.pptxCAO.pptx
CAO.pptx
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
 
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
 
8085 Microprocessor Architecture
8085 Microprocessor Architecture8085 Microprocessor Architecture
8085 Microprocessor Architecture
 
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.2-overview of register transfer, micro operations and basic c...
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1)
 
Computer Organization and Architechuture basics
Computer Organization and Architechuture basicsComputer Organization and Architechuture basics
Computer Organization and Architechuture basics
 
Ch5_MorrisMano.pptx
Ch5_MorrisMano.pptxCh5_MorrisMano.pptx
Ch5_MorrisMano.pptx
 
Introduction to ARM Architecture
Introduction to ARM ArchitectureIntroduction to ARM Architecture
Introduction to ARM Architecture
 

Mehr von Daniel Roggen

Embedded Sensing and Computational Behaviour Science
Embedded Sensing and Computational Behaviour ScienceEmbedded Sensing and Computational Behaviour Science
Embedded Sensing and Computational Behaviour ScienceDaniel Roggen
 
W9_3: UoS Educational Processor: Assembler Memory Access
W9_3: UoS Educational Processor: Assembler Memory AccessW9_3: UoS Educational Processor: Assembler Memory Access
W9_3: UoS Educational Processor: Assembler Memory AccessDaniel Roggen
 
W9_2: Jumps and loops
W9_2: Jumps and loopsW9_2: Jumps and loops
W9_2: Jumps and loopsDaniel Roggen
 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorDaniel Roggen
 
Wearable technologies: what's brewing in the lab?
Wearable technologies: what's brewing in the lab?Wearable technologies: what's brewing in the lab?
Wearable technologies: what's brewing in the lab?Daniel Roggen
 
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...Daniel Roggen
 
Wearable Computing - Part III: The Activity Recognition Chain (ARC)
Wearable Computing - Part III: The Activity Recognition Chain (ARC)Wearable Computing - Part III: The Activity Recognition Chain (ARC)
Wearable Computing - Part III: The Activity Recognition Chain (ARC)Daniel Roggen
 
Wearable Computing - Part II: Sensors
Wearable Computing - Part II: SensorsWearable Computing - Part II: Sensors
Wearable Computing - Part II: SensorsDaniel Roggen
 
Wearable Computing - Part I: What is Wearable Computing?
Wearable Computing - Part I: What is Wearable Computing?Wearable Computing - Part I: What is Wearable Computing?
Wearable Computing - Part I: What is Wearable Computing?Daniel Roggen
 

Mehr von Daniel Roggen (12)

Embedded Sensing and Computational Behaviour Science
Embedded Sensing and Computational Behaviour ScienceEmbedded Sensing and Computational Behaviour Science
Embedded Sensing and Computational Behaviour Science
 
W10: Laboratory
W10: LaboratoryW10: Laboratory
W10: Laboratory
 
W10: Interrupts
W10: InterruptsW10: Interrupts
W10: Interrupts
 
W9: Laboratory 2
W9: Laboratory 2W9: Laboratory 2
W9: Laboratory 2
 
W9_3: UoS Educational Processor: Assembler Memory Access
W9_3: UoS Educational Processor: Assembler Memory AccessW9_3: UoS Educational Processor: Assembler Memory Access
W9_3: UoS Educational Processor: Assembler Memory Access
 
W9_2: Jumps and loops
W9_2: Jumps and loopsW9_2: Jumps and loops
W9_2: Jumps and loops
 
W8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational ProcessorW8_2: Inside the UoS Educational Processor
W8_2: Inside the UoS Educational Processor
 
Wearable technologies: what's brewing in the lab?
Wearable technologies: what's brewing in the lab?Wearable technologies: what's brewing in the lab?
Wearable technologies: what's brewing in the lab?
 
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
Wearable Computing - Part IV: Ensemble classifiers & Insight into ongoing res...
 
Wearable Computing - Part III: The Activity Recognition Chain (ARC)
Wearable Computing - Part III: The Activity Recognition Chain (ARC)Wearable Computing - Part III: The Activity Recognition Chain (ARC)
Wearable Computing - Part III: The Activity Recognition Chain (ARC)
 
Wearable Computing - Part II: Sensors
Wearable Computing - Part II: SensorsWearable Computing - Part II: Sensors
Wearable Computing - Part II: Sensors
 
Wearable Computing - Part I: What is Wearable Computing?
Wearable Computing - Part I: What is Wearable Computing?Wearable Computing - Part I: What is Wearable Computing?
Wearable Computing - Part I: What is Wearable Computing?
 

Kürzlich hochgeladen

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Kürzlich hochgeladen (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 

W8_1: Intro to UoS Educational Processor

  • 1. 1 Digital Systems and Microprocessor Design (H7068) Daniel Roggen d.roggen@sussex.ac.uk 8.1. Intro to UoS educational processor
  • 2. 2 UoS Educational Processor • Developed in 2014 for "Digital Systems and Microprocessor Design" at University of Sussex by Daniel Roggen • License: LGPL 2.1 • https://github.com/droggen/uos_educational_processor.git • https://opencores.org/project,uos_processor
  • 3. 3 General processor • Instruction and data memory outside of processor – One reason: different semiconductor technologies – Higher densities with dedicated chips program counter
  • 4. 4 What's next: Educational Processor • 8-bit, 4 register processor, Von Neumann architecture • 3 clock cycle per instruction • 16-bit instruction set (inspired by x86 ISA) – Direct, indirect, immediate, register addressing • Customizable instructions • External memory bus (for program/data) • I/O interface (as in microcontrollers) • Implemented in VHDL • Synthesizable
  • 5. 5
  • 6. 6 Educational processor overview • Control unit: loads the instruction from memory and controls its execution – Memory interface: whether to read or write memory (we: write enable), where to read (address), the data to write (datawr) and gets the data from memory with datard – External interface: whether to write or read – The ALU operation – The input to the register bank – The input to the ALU
  • 7. 7 Educational processor overview • Register bank: 4 8-bit registers RA,RB,RC,RD – Provides two outputs from any two registers (asynchronous output). Registers to read from are specified by control lines. – Allows to synchronously write to one register. Register to write to, and whether to write, is controlled by control lines. – Registers (to read or write) are identified by a 2-bit code: RA=00, RB=01, RC=10, RD=11
  • 8. 8 Educational processor overview • Register bank input: select data written to the register bank (if a write occurs in the register bank) • Data to register bank can come from: ALU output, memory interface, external interface, another register, or the instruction
  • 9. 9 Educational processor overview • ALU input: select data fed to ALU • ALU input data can come from the register bank or from the instruction
  • 10. 10 Educational processor overview • The ALU takes two inputs and performs a logical or arithmetic operation defined according to the control line
  • 11. 11 Educational processor overview • The external interface allows to read or write data from a parallel interface on the processor • This is commonly used in microcontrollers to connect peripherals (LEDs, buttons) • During a write the interface stores the value to put on ext_out (D FF). • No special operation during read, however more advanced external interfaces could perform signal conditioning (e.g. debouncing)
  • 12. 12 Educational processor overview • The memory interface allows to connect to an external memory • In this educational processor the memory interface is transparent (no special function). • More advanced processors may have special interfaces to read from DRAM, SRAM, SD cards, etc.
  • 13. 13 Educational processor overview • Processor ports: memory interface, exernal interface, clock and reset • Reset is synchronous! (occurs on the rising edge of clock) • More advanced processors may have several memory and external interfaces, additional pins to generate "interrupts" (branch of the execution flow when a pin is toggled), etc.
  • 14. 14 Educational processor on FPGA • The processor is synthesized on the FPGA as any other component with the entity port map syntax. • A 32 bytes memory is synthesized alongsize the processor for program and data. It has 32 entries (5 bit address) of 8 bits • Push buttons allow to generate single clocks to test the processor • LED and switches connected to external interface Memory From switches To LEDsPush button
  • 15. 15 Stored program (von Neumann) • Instructions represented as number in memory • Programs are just like data • However: – Program goes to the control unit – Data goes to the data path
  • 16. 16 Instruction • An instruction defines the operation of the processor when it is executed • An instruction is defined by it's bit-width and whether it is fixed-length or variable length – Fixed length lead to easier implementation but use more memory – Variable length can optimize the size for frequent instruction • It comprises multiple fields: opcode (operation code), source, destination, etc. • Different processor architectures have different instruction sets with their own encoding
  • 17. 17 Instructions in the educational CPU • All instructions are 16-bit wide (fixed size) • 3-bit opcode (operation code): indicates the type of operation • The meaning of the remaining bits depends on the opcode! instr(15..13) instruction(12..8) instruction(7..0) Opcode depends on the instruction src
  • 18. 18 Program counter / Instruction pointer • PC or IP: register in the processor control unit that indicates the memory location where the instruction is fetched • PC starts at zero on reset • As instructions are 16 bits, the first instruction is at memory location 00 and 01; the second instruction at memory location 02 and 03;... • PC incremented continuously for usual instructions • Except with "jump" instructions: the PC changed to fetch instruction from another location
  • 19. 19 Encoding v.s. "assembler" instruction • All instructions are 16-bit data stored in memory • The instructions can be specified by their binary code: – 1000001010101 • Or to simplify reading by their hex code: – 1055h • To further simplify reading we use a human readable format: – mov ra,55h • We refer to this format as an "assembler" instruction because a software (or human) would read the text "mov ra,55h" and "assemble" the various parts of the encoding to obtain 1055h
  • 20. 20 Opcodes • Defines the "category" of the instruction • 3-bit opcode: total of 8 "categories" of instructions • Defined in order to help the decoding of the instruction. • All instructions of the same opcode share the same encoding • Opcode 000: move instructions • Opcode 001: ALU instructions • Opcode 010: ALU instructions • Opcode 011: ALU instructions • Opcode 100: unused • Opcode 100: ALU instructions • Opcode 101: jump instructions • Opcode 110: external interface instructions • Opcode 111: unused
  • 21. 21 Move instructions (opcode 000) • Moves data between registers, immediate and memory • mov dst,src – moves the data specified by source into destination Instructions instruction(15..8) Instruction(7..0) Move Opcode dd#m sd#m dreg src mov r, r 0 0 0 0 0 0 r r - - - - - - r r mov r, i 0 0 0 1 0 0 r r i i i i i i i i mov r, [r] 0 0 0 0 0 1 r r - - - - - - r r mov r, [i] 0 0 0 1 0 1 r r i i i i i i i i mov [r], r 0 0 0 0 1 0 r r - - - - - - r r mov [r], i 0 0 0 1 1 0 r r i i i i i i i i IR /
  • 22. 22 immediate/register • the src field contains the "source" data for the instruction (sometimes unused) • Source can be immediate or register depending on R'/I • R’/I=1: src is an immediate: the 8 LSBs in the instruction are used as the data • R’/I=0: src is a register: the data comes from a register. The register is specified by the 2 least significant bits in src – RA: 00 – RB: 01 – RC: 10 – RD: 11 Instructions instruction(15..8) Instruction(7..0) Move Opcode dd#m sd#m dreg srcIR /
  • 23. 23 direct/indirect • Source: direct or memory mode specified by sd#m • Direct mode: the value of a register or immediate is moved to dst • Memory mode: the instruction fetch the data from the memory location specified by src (which can be immediate or register) • Syntax: use brackets around src to indicate memory mode – mov ra,[55h] Instructions instruction(15..8) Instruction(7..0) Move Opcode dd#m sd#m dreg srcIR /
  • 24. 24 destination • Destination is always a register (direct) or a memory location (memory mode) specified by a register, depending on dd#m • Direct mode: the value of source is moved to a register • Memory mode: the instruction will fetch the data from a memory location. • Syntax: use brackets around dst to indicate memory mode – mov [ra],55h Instructions instruction(15..8) Instruction(7..0) Move Opcode dd#m sd#m dreg srcIR /
  • 25. 25 Move examples • mov ra,rb: – src is direct, register: moves the content of reg b into reg a – dst is direct register • mov ra,13h: – src is direct, immediate: moves 13h into reg a – dst is direct register • mov ra,[rb] – src is memory, register: moves the data at the memory location b into a – dst is direct register • mov ra,[13h]: – src is memory, immediate: moves the data at the memory location 13h into a – dst is direct register • mov [ra],rb: – src is register: – dst is memory: moves the content of reg b into reg a
  • 26. 26 ALU (opcodes 001,010,011) • Performs an arithmetic/logic operation on one or two operands • instr dst, src – Performs a two operand operation on dst and src and puts the result in dst • instr dst – Performs a single operand operation on dst and puts the result in dst • dst is always a register • src is a register or an immediate
  • 27. 27 ALU: two operands • ALU op indicates which ALU operation • src: source (immediate/register according to R'/I) • dst: destination Instructions instruction(15..8) Instruction(7..0) ALU 2 op opcode ALU op dreg src add r, r 0 0 1 0 0 0 r r - - - - - - r r add r, i 0 0 1 1 0 0 r r i i i i i i i i sub r, r 0 0 1 0 0 1 r r - - - - - - r r sub r, i 0 0 1 1 0 1 r r i i i i i i i i and r, r 0 0 1 0 1 0 r r - - - - - - r r and r, i 0 0 1 1 1 0 r r i i i i i i i i or r, r 0 0 1 0 1 1 r r - - - - - - r r or r, i 0 0 1 1 1 1 r r i i i i i i i i xor r, r 0 1 0 0 0 0 r r - - - - - - r r xor r, i 0 1 0 1 0 0 r r i i i i i i i i IR /
  • 28. 28 Examples • add RA,RB – Stores RA+RB in RA • sub RA,03h – stores RA-3 in RA. • and RD,55h – stores the logical AND of RD and 55h in RD Always indicate numbers by a 2 digit with an h at the end for hex! Avoids confusion between register RA and value Ah
  • 29. 29 ALU: comparison • Comparison: cmp dst,src • src: source (immediate/register according to R'/I) • dst: destination • Comparison is performed by subtracting src from dst! • Result of the comparison is stored in flags: carry and zero – Zero=1 Carry=0: dst=src – Zero=0 Carry=0: dst>src – Zero=0 Carry=1: dst<src • Result of comparison used by conditional jump Test opco de ALU op dr eg immedite / reg cmp r, r 0 1 0 0 0 1 r r - - - - - - r r cmp r, i 0 1 0 1 0 1 r r i i i i i i i i IR /
  • 30. 30 ALU: one operand • Format: instr dst • The operation is applied on dst and the result is in dst • Example: – not ra – asr rb Instructions instruction(15..8) Instruction(7..0) ALU 1 op opcode ALU op dreg not r 0 1 1 0 0 0 r r - - - - - - - - shr r 0 1 1 0 0 1 r r - - - - - - - - ror r 0 1 1 0 1 0 r r - - - - - - - - asr r 0 1 1 0 1 1 r r - - - - - - - - rol r 0 1 1 1 0 0 r r - - - - - - - -
  • 31. 31 Jumps (opcode 101) • Unconditional jumps: changes the value of PC to destination – jmp dst • Conditional jumps: changes the value of PC if a condition is met. Condition is tested by checking the flags (carry, zero). Flags are set by a prior comparison • JA: jump if above – Jumps if Zero=0 and Carry=0 • JB: jump if below – Jumps if Zero=0 and Carry=1 • JE: jump if equal – Jumps if Zero=1
  • 32. 32 Compare / jump examples Carry Zero mov ra,0Ah 0 0 cmp ra,09h 0 0 cmp ra,0Ah 0 1 cmp ra,0Bh 1 0
  • 33. 33 Compare / jump examples Carry Zero mov ra,0Ah 0 0 cmp ra,09h 0 0 jb dst1 -- not taken: RA not below 9h je dst2 -- not taken: RA not equal 9h ja dst3 -- taken: RA above 9h
  • 34. 34 Compare / jump examples Carry Zero mov ra,0Ah 0 0 cmp ra,0Ah 0 1 jb dst1 -- not taken: RA not below Ah je dst2 -- taken: RA not equal Ah ja dst3 -- not taken: RA not above Ah
  • 35. 35 Compare / jump examples Carry Zero mov ra,0Ah 0 0 cmp ra,0Bh 1 0 jb dst1 -- taken: RA below Bh je dst2 -- not taken: RA not equal Bh ja dst3 -- not taken: RA above Bh
  • 36. 36 External interface (opcode 110) • Out: write register or immediate to the external interface • In: read data from the external interface into a register Instructions instruction(15..8) Instruction(7..0) IO opcode IO type dreg src out r 1 1 0 0 0 0 - - - - - - - - r r out i 1 1 0 1 0 0 - - i i i i i i i i in r 1 1 0 - 0 1 r r - - - - - - - - IR /
  • 37. 37 Instruction fetch and execution • Instructions are 16 bit but memory is 8 bit! • Two cycles needed to fetch the instruction • One cycle for execution • Consequence: 3 clock cycles per instruction
  • 38. 38 Summary • The architecture and features of the processor are clear at a high level • The characteristics of the instruction set are understood: – Instruction execution time – Instruction encoding – Instruction set (move, alu, jump, external) and its characteristics (register/immediate, direct/memory)