Escolar Documentos
Profissional Documentos
Cultura Documentos
1. Course overview
2. Intro to PICOBLAZE, C and Number systems and Boolean Algebra
3. Course overview with microprocessor MU0 (I)
4. Course overview with microprocessor MU0 (II)
5. Verilog HDL
6. Digital system components using schematics and Verilog
7. Combinational logic standard forms. Karnaugh maps
8. Combinational ccts and congurable logic devices
9. Simple Sequential circuits, ip ops
10. Sequential circuits, counters, registers, memories
11. Non-ideal effects in digital circuits
12. Finite State Machines
13. Design of FSMs
14. Design of FSMs
15. Datapaths
The Small-Scale Experimental Machine, known as SSEM, or the "Baby", was designed and built at
The University of Manchester, and made its first successful run of a program on June 21st
1948. It was the first machine that had all the components now classically regarded as
characteristic of the basic computer. Most importantly it was the first computer that could store
not only data but any (short!) user program in electronic memory and process it at electronic
speed.
FF..FF16
instructions
registers address
data
processor
instructions memory
and data
00..0016
MU0 is a 16 bit machine with a 12 bit address space
Instructions are 16 bits long with a 4 bit opcode and a 12 bit address word
The datapath: All the components carrying (buses), storing (registers) or
processing (alu, mux) bits in parallel form the components of the datapath.
Use the RTL description actually datapath for us!
The Control Logic: Everything else such as decode and control use FSM
approach.
3213: Digital Systems & Microprocessors: L#16-17
MU0 Datapath design
Need a guiding principle to limit design possibilities usually based on clock
constraint in microprocessors
Each instruction takes the number of clock cycles equal to the number
of memory accesses it must make
The processor must start in a known location we can do this with a reset.
4 bits 12 bits
opcode S
We assume that all registers change state on the rising edge of the clock
(c.f negative edge Furber probably because external SRAM used for the
actually memory is posedge triggered??).
For the registers the control signals prevent or disallow transitions at the clock.
There are also feedback control signals from the datapath to the control FSM
opcode bits, signals from the accumulator indicating whether its contents
are zero or negative which control the respective conditional jump instructions.
All we need to do is develop a two state FSM to generate the control signals
Other
Inputs Outputs
Inputs ...
...
Inputs
Inputs
...
output [15:0] q;
input [15:0] d;
input clk;
input en;
Memory comes from memory input rs;
reg [15:0] q;
end
endmodule // v_reg16
Note that Eno is always defined; this is because it is essential to know if the total
register is to change or not on any given clock edge. If it is changing (Eno = 1)
then R/W and Clr control what it is doing; however if it is not changing
(Eno = 0) then it doesnt matter what value is presented to the register it will
ignore it.
control
PC IR
memory
ALU ACC
data bus
transfer IR
opcode
level PC
ACCoe
organization
Asel PCce
ALUfs ALU
B A
ACCce
ACC[15]
ACC
ACCz
Bsel 0 mux 1
JM P S 0100 m
PCe m 1 6[S
:= S]
5000
7000
JG E S 0101 if A C C > = 0 PC :=
JN E S 0110 if A C C != 0 PC := S
0004
STP 0111 s to p
0001
3213: Digital Systems & Microprocessors: L#16-17
MU0 Function
ADD d, s1; d := d + s2
f bits n bits
function op 1 addr.
f bits
function
1+2
0x0006
0x01 0x0007
0x02 0x0008
0x0006 Indirect
0x0008 0x0007
0x02 0x0008 Immediate
Register
number
0x02 regnum
Immediate
0x0006 Register
0x0007 number
0x0008 regnum
// Set the data signals (D0-7) of the port to all low (0) */
outb(255, BASEPORT);
B LABEL
LABEL
Branch if a particular register is zero / non-zero / negative etc
Branch if the contents of two specified registers are equal or not
Some processors have special purpose registers (conditional code
registers or flag registers that store flags which are the results of
particular instructions.
Solutions:
Extra hardware to allow the branch instruction to be calculated
Speculative calculation of the branch during the DEC cycle
i.e. before we know it is a branch!
3213: Digital Systems & Microprocessors: L#16-17
Pipelined branch behaviour
1 (branch) fetch dec reg ALU mem res
Hard wired instruction decode logic like MU0 CISC processors
used large microcode ROMs to decode logic (still in use...)
Pipeline execution. CISC processors usually do not
Single clock cycle execution. CISC typically took many instructions
Add successful instructions of competitors
New feature hype
Compatibility: only extensions are possible
The compiler writer
Less instructions probably easier job
Simpler instructions probably less bugs
Can reuse optimisation techniques
RISC
SPSR_und
SPSR_abt SPSR_irq
CPSR SPSR_fiq SPSR_svc
31 28 27 8 7 6 5 4 0
NZCV unused IF T mode
ARM memory organization
bit 31 bit 0
23 22 21 20
19 18 17 16
word16
15 14 13 12
half-word14 half-word12
11 10 9 8
word8
7 6 5 4
byte6 half-word4
3 2 1 0 byte
byte3 byte2 byte1 byte0 address
The structure of the ARM cross-
development toolkit
C source C libraries asm source
C compiler assembler
.aof
object
libraries
linker
.axf debug
ARMsd
system model
development
ARMulator
board
ARM shift operations
31 0 31 0
00000 00000
LSL #5 LSR #5
31 0 31 0
0 1
00000 0 11111 1
31 0 31 0
C
C C
ROR #5 RRX
Multiple register transfer addressing
r9
modes 1018
16 r9 r5 1018
16
r5 r1
r1 r0
r9 r0 100c 16 r9 100c 16
1000 1000
16 16
1018 1018
16 16
r9 r5 100c 16 r9 100c 16
r1 r5
r0 r1
r9 1000 r9 r0 1000
16 16
Load/store architecture
A large array of uniform
registers
Fixed-length 32-bit
instructions
3-address instructions
37 registers
1 Program counter
1 current program status
registers
5 saved program status
registers
30 general purpose
registers
8-bit Byte
16-bit Half word
32-bit word
mode bits
overflow state bit
carry/borrow FIQ disable
zero IRQ disable
negative