You are on page 1of 28

A VERY SIMPLE MICROPROCESSOR JANUARY 2005

! " # $%
#

1. Introduction
% % ! &' % %& # (
# # & ) ! *+ ,--. ! # */
0 # !
# 1# 2 31 ! ,

#
*

• #
• 6
4

&

& 3
'535(

7 3

! # * # # ,

1 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

* * 8
& ! 9999 ,,,, $#
! 1
99991 # ! !

& 535#
5# ! : ! ! # !1
! # 1!

# $#
$%# 4 2
' # (1 #
$#
# # # !
3 #
4 4 ! $#
; < ' (
7
; <= <, ' # (
! ! $#

7 7 ! ! # $#
4 1 ! !
!
! ! *
! !

# # 1 / # 0' ( # * ! > *
! # 1 ! / # 0? 3 1 #
@ 1 $# ! #

! # ! > ! # #
# *1 ! !

2 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

#
*

#
4

&

&
'535(

7 3

# 8 * ! #
# & ! ' 4 (
#
# & ! '? ! # (
#
# ! ! 3 #

! "

2. Instructions
# # $# 1 ,A !!
#

No Operation (NOP=0000)
B 7 !! C 1
# * *

Addition (ADD=0001)

! 1
! ! # ? 3 1 ;>1
/ .0 ; <.1 ;><. ! ! D

3 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

Subtraction (SUB=0010)

! # 1
# ! ! #

Get Input (In=0011)

Give Output (OUT=0100)

! # 8
* # ! # /E 7 0

Load Instruction (LDA=0101)

6 ! / 0? 3 1 6 - ! -
',99, # ! (

3. Program Memory
5# 1 # 3
5# ! # !1 ! #
! />01 /,01

# ! . 5 1 5
F ! # * @
1 # # ! #
#

4 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

G A D $ . > , 9

# $% & # $% &

6 > 9,9, H99,9 93D>


, 99,9 H999, 93>,
74 9,99 H9999 93$9
B7& 9999 H9999 9399

' ! () * * %
# # # + *) # , * * -# # ./ "
//"01 #203

' * !$ ) (,( + &

5 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

4. Executing the instructions

Introducing the micro-instructions

! 3 # 3 !
# ! !! 1 ! $ *
# ! /6 >0 !
/6 >0 1 91,1> $

' %

4 , 4 2
$* & $* & 4

0 #% * 2
# , #

% , # , * # 5

3 ! 1 ! 1 # ! !
! 2 ! I

& , ! #

& >

& . 3 , 1
* ! ! 3
& $ 3 > * !
3

% , # *

6 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

# #

& >
& ,

4 4

& &

& &
'535( '535(

3 3

. #
7 3 7 3

& , & >

6 , * 4

No Operation (NOP=0000)

? 2 ' ;,(1 !
'6 ;,( , '? D( >1
1 JB 7 I !!
1 3 '& . $( !

7 #

. #

3 8

3 3 3 ' 3 %

$
& , 203

6 203 # , 4

7 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

Addition (ADD=0001)

! # $%# !
2 1 3 # 1 *
# '& $(1 ! #
! # * ! * $1 !
A

# #

& $
& .
. #

4 4
## 9
$ //&
& &

& &
'535( '535(

3 3

7 3 7 3

& . & $

7 #

. #

1*#

3 8

. #:

. #

3 3 3 ' 3 %

$
& , .0 /

5 , * # //

8 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

Subtraction (SUB=0010)

3 ! # !
!! / #0 91 / # 0

Get Input (In=0011)

! . '? A( $1

# #

& $
& .

4 4

& &

& &
'535( '535(
3
3

7 7 3

& . & $

7 #

. #

1*#

3 8

. #
3 3 3 ' 3 %

$
& , 2

; , * # 2

9 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

Give Output (OUT=0100)

! ! # .
8 * # * !
$

# #

& $
& .

4 4

& &

& &
'535( '535(

7 3 7 3

& . & $

( , * # 01

Load Instruction (LDA=0101)

! $%# ! 6 ?
3 1 6 - ! -',99, # ! ( ! G1
! ! # ! # !
1 ! ,99, $
# #

& $
& .

4 4

& &

& &
'535( '535(

3 3

7 3 7 3

& . & $

10 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

7 #

. #

1*#

3 8

. #

3 3 3 ' 3 %

$
& , .0 /

< # * ' , # * +/ * %"


* -+

5. Basic Block design

@ ! #%# * !

Accumulator A

# ! % % #
9 .! 4 1 ! # !
# / # 0 @ # #
/ 0 8 ! ! 'C 1 * # ( % ! !
*

11 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

= #
$ ) + &

Accumulator B

! 1 # ! % %
# 9 .! 4 / 0 8
! ! 'C 1 * # ( % ! ! *

: $ )
:&+

12 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

Add/subtract Block

# ! #% 1 # # K I
! ! !L7 ! /4 0 3 ! / 0
1 ! ,>

## $ ) ## + &

$%# ! 2 ! ! % ! ,.
! !

# # ' % ( ! % 1 #
:
• >I !
• ,

7 3 1 # ! # 1
# 1 #% / 0@ / 02 91 9 ! 1 1
, ! 2 1/ #0;9 ! ! 1
' (1 / #0;, ! != ' # (

13 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

' !* // # 1: * $ )
1 + &

1 !
2 !
1 ! ,$ * # 1
# #

! ! 2 # :
• % 1 9' ! (1
' ;91 ;9( B *
# /= 0 ,
• 6 * * # / 01! 3 . */6 0
! * . ! !
*
• 6 * * # / 01! 3 > */6 0
! * > ! !
* < / #0 # ! 91
C / # 0 9
• / # 0 , /D01 ! ,$

14 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

% ": # // # 1:
$ )7 7 : +8>&

The input register

! .% # !! 1 ! ,D ! %
# !

15 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

6 * $ ) 7 +8>&

The output Register

# % # 7 ! *1
! * .1
1 8 ! ! 1 B B *
! *1 ! ,A
/ # 01
#

' %

01 4 01 , 4
$* & $* &

5 * # # * '

16 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

; * $ )0 7 +8>&

A manual microprocessor

1 # / % 0
1 1 ! ! ,5 !
! ' ( ' 7 ( ! !1 #
' # (1 # 3 ! *1 !
* # 'D ( ! #
! :


• ! !

# ' # / 01 # / 0( #
* # 3 ! ,51 # #
# * # !
3 1 # !! 1 / *01
/ 0B

17 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

( : # $ ? +8>&

< !) # * $ )7 7 : 0 +8>&

The Phase Generator

! J I ! # 1
# ? 1
! & 9 & .1 ! *

18 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

# # / 0 ! #
L7 1 ! >9

= * $ )7 8 %+ &

* $ )7 8 %+ &

@ # ' (1 2

Program Counter 0 to 15

! '? >>( 1 9 1 !
1 1 3

19 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

&

&
'535(

7 3

* ** * ! ## -

7 # ! 9 ,D % % 1 #
1# * # 1
!
> !
2 1 3 3 ,1

' * +8 # !# * " #
$ )8 5+8>&

20 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

The Instruction Register

! 5%# ! :
! # !1 ! #
# ! % # !! >.1 #
# ! 1 ! % 1
# # # !
1 # ! #

G A D $ . > , 9

# $% & # $% &

% ! # * # * $.
& # * $ ** &$ ) 7 +8>&

21 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

The MicroInstruction Controler

J I !
J # I J I ! !1
! ! B ? 3 1 9999
B 1 B7& B 9 ,
# !
! 1 ! 1 , ! 1 * 9
#

6 4 *

The Complete Microprocessor

#% #%# * #
# # ! >A
C 1 * / 0 3
! 1

22 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

3 ! >A1 # :

6 , 9,9, H999, 93D,


> 99,9 H99,9 93>>
74 9,99 H9999 93$9

5 # # * !

'>( '.( $ '$( ?


*

'A(
#

',(

'5( 7
#

'D( 'G(

5 * #! $ ) * +8>&

7 1 :
• % ',(
• * *'>(
• ! *1 # !! 9 ,1 >1 .
# * 9 '.(
• >1
'$(1 /6 '9,9,(0
• F 'D(
• ! ! # 'A(
• ! 2 # 1 * # # 'G(
• ! /74 0 1 1 '5(

23 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

; ## # * * * # 5$ )
* +8>&

Memory Move

7 ! B7 # ' 7 (
! ! 1 @
I # ! ! ! M !
# ! ! !

7 ! ! 1 !
! 2 : .1 1
# # !
# 1 ! !! #
! >5

24 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

# #

& &

&

4 4

$& ,
&
3
$ &/
* !

& &
'535( '535(

3 $'& ! 3
##

7 3 7 3

: 7 # : 7 # #

( #! * # 0

1 7 # 8 # # '@
# (1 $%# # ! 1
& K 3

Physical Implementation

Description of the design flow

# # C1
! # 7@ B !
! >- @ 67E ! "
→ # $ " 3! %&%1 67E 1
! 7@ B 1 !
7@ B 1 → # $ "

25 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

C.

' !(
' %&%(

7@ B

' '(

< 8 * # * " 7 .0@

VERILOG translation

# 1 .,> # !
! #
% 67E

'= A ! # 7 .0@
# ## *

26 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

' * - 7 .0@ # * %) * $- )
* +8>&

! 1 %# 535# *
3 # # !535 #
! .9 !
# # J@ I 'B,(

' # - ! * ! # - $- ) ! + &

'. 5 (
5#

27 etienne.sicard@insa-toulouse.fr 07/01/05
A VERY SIMPLE MICROPROCESSOR JANUARY 2005

Conclusion

1 $%# # 1 D #
! ! # 3 3 1
3 # 1 ! 1
#

References

),+ & 1N / 01 1E % 1 B 9%9>%


599D-$%D1,-->14

28 etienne.sicard@insa-toulouse.fr 07/01/05