A Very Simple M icroprocessor 1. Introduction

A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
!
"
#
$%
#
1. Introduction
%
%
!
#
#
&
) !
0
*+
#
#
1#
&'
,--.
!
%
%&
# (
# */
!
2
31
!
,
#
*
•
•
#
6
4
&
3
&
'535(
7
!
1
# *
#
3
# ,
[email protected]
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
# 1
!
@
1
!
# 0' (
# 0?
3
# *
!
1
>
*
#
!
#
#
# *1
2
/
/
$#
!
!
!
>
!
#
#
!
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
#
*
#
4
&
&
'535(
3
3
7
#
8
#
*
&
!
#
!
'
4 (
#
#
&
!
'?
!
# (
#
#
!
!
3
#
!
"
2. Instructions
#
#
$# 1
,A
!!
#
No Operation (NOP=0000)
B 7
!!
#
*
C
1
*
Addition (ADD=0001)
!
1
!
/
3
.0
!
#
; <.1
?
;><.
!
[email protected]
3
!
1
;>1
D
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
! /
',99,
#
0?
!
3
1
6
-
!
-
(
3. Program Memory
5#
5#
!
1
# 3
#
!1
!
!
/>01
#
!
F
.
5
!
/,01
1
#
1
#
5
*
@
#
# !
#
#
4
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
G
JANUARY 2005
A
D
# $%
6
.
>
&
#
,
$%
>
9,9, H99,9
93D>
,
99,9 H999,
93>,
74
9,99 H9999
93$9
B7&
9999 H9999
9399
'
!
#
//"01
'
5
$
()
*
#
*
#
+
9
&
%
*) # , *
* -# #
./ "
#203
*
!$
)
(,(
+ &
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
4. Executing the instructions
Introducing the micro-instructions
!
3
#
#
!
!!
3
1
!
#
/6
1
91,1>
&
0
%
3
!
&
,
&
>
&
.
1
,
!
*
1
#
#
5
!
2
!
!
!
3
$
3
I
#
,
1
*
&
2
#
!
$
4
&
*
#
,
!
2
4
$*
#%
# ,
>0
%
,
4
*
/6
'
$*
$
!
>0
!
!
>
!
3
*
!
3
%
6
,
#
*
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
#
&
#
&
,
>
#
4
4
&
&
&
&
'535(
'535(
3
. #
3
7
&
6
3
3
7
,
&
,
>
*
4
No Operation (NOP=0000)
?
2
'
'6
;,(
, '?
D(
JB 7
3
'&
.
!
>1
1
1
;,(1
$(
I
!!
!
7 #
. #
3
8
3
3
3
$
&
6 203
7
# ,
'
3
,
203
%
4
[email protected]
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
$
&
5
8
,
'
3
,
.0 /
* #
[email protected]
%
//
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
$
,
&
;
9
,
3
'
* #
[email protected]
%
2
2
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
Give Output (OUT=0100)
!
!
#
8
*
#
.
*
!
$
#
&
#
&
.
$
4
4
&
&
&
&
'535(
'535(
3
3
7
&
(
3
7
.
&
,
* #
$
01
Load Instruction (LDA=0101)
!
3
1
!
!
$%#
6
-
#
!
!
!
-',99,
#
6
!
?
(
!
#
1
!
!
,99,
$
#
&
#
&
.
$
4
4
&
&
&
&
'535(
'535(
3
7
&
10
G1
3
3
.
7
&
[email protected]
3
$
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
#
/
0
!
%
.!
/
%
#
4
#
8
0
1
!
@
!
!
#
!
#
'C
1 * #
(
#
%
!
!
*
11
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
=
$
#
)
+ &
Accumulator B
!
1
#
#
!
!
9
'C
!
.!
1 * #
(
%
%
4
%
/
!
:
!
0
8
*
$
)
:&+
12
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
Add/subtract Block
#
!
!
1
#%
!
!
1
#
!L7
#
!
I
/4 0
3
!
/
0
,>
## $
$%#
K
!
2
!
)
## + &
! %
!
!
,.
!
#
#
' %
(
! %
1
#
:
•
>I
!
•
,
7
3
#
,
'
13
1 #%
/
0@
!
2
(1
/
#0;,
/ 02
1/
1
# !
91
9
#0;9
#
!
1
!
!
!=
[email protected]
1
1
!
'
1
#
(
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
0
!
!
*
•
6
*
* #
!
/ 01!
<
>
/
#0
C
14
/
#
0 ,
>
*
*
•
3
#
/
/D01
!
[email protected]
!
#
91
0 9
,$
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
%
":
$
)7
7 :
#
//
# 1:
+8>&
The input register
! .%
#
15
# !! 1
!
,D
!
%
!
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
6
*
JANUARY 2005
$
) 7
+8>&
The output Register
#
%
#
7
!
!
1
8
!
/
#
!
*1
!
! 1 B B
*1
*
.1
*
,A
01
#
8
'
01
$*
5
16
*
4
&
%
01
#
,
$*
4
&
#
[email protected]
*
'
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
;
*
$
)0 7
+8>&
A manual microprocessor
1
#
/
%
1 1
!
!
'
'
#
0
(
'
(1
* #
'D
!
:
!
7 (
#
!
,5
!1
3
!
#
!
*1
(
!
!
#
•
•
•
!
!
# '
#
*
/
#
01
3
!
#
3
1
#
# /
*
0(
#
,51
#
#
#
!!
!
1
/ *01
/ 0B
17
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
( : #
<
$
!)
#
*
$
)7
7 :
?
+8>&
0 +8>&
The Phase Generator
!
J
I
!
#
!
18
?
&
9
&
.1
!
#
1
1
*
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
#
#
L7
=
JANUARY 2005
/
1
0
!
!
*
>9
$
)7
*
@
#
#
$
'
8
)7
%+ &
8
(1
%+ &
2
Program Counter 0 to 15
!
1
19
'?
>>(
1
1
9
1
!
3
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
#
4
&
&
'535(
3
3
7
*
7
**
#
!
1#
9
*
,D
!
##
%
%
-
1
*
#
#
1
!
> !
2
1
3
'
*
$
20
3
)8
,1
+8
#
!#
*
"
#
5+8>&
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
The Instruction Register
!
!
5%#
#
!1
#
!
#
!
#
1
A
$
.
&
>
#
,
$%
%
21
*
$ **
#
%
1
9
&
! # *
#
>.1
! #
D
# $%
#
!
#
G
&
!!
1
#
:
!
%
# !
#
!
&$
)
# *
$.
7 +8>&
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
The MicroInstruction Controler
J
J
# I
J
I !
I
!
!
!
B
!1
B
?
1
B7&
1
!
1
B
#
!
3
9999
9
,
!
1
, !
1 *
9
#
6
4
*
The Complete Microprocessor
#%
#
C
#
1
!
22
#%# *
!
*
/
0
#
>A
3
1
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
3
!
6
JANUARY 2005
>A1
#
,
9,9, H999,
93D,
>
99,9 H99,9
93>>
9,99 H9999
93$9
74
5
:
#
#
'>(
*
'.(
!
$
'$( ?
*
'A(
#
',(
'5( 7
#
'D(
5
'G(
*
7
#!
$
1
•
%
•
*
+8>&
:
*'>(
!
# *
*1 #
!!
9
,1
>1
.
9 '.(
•
>1
'$(1
•
*
',(
•
/6
'9,9,(0
F
•
23
)
'D(
!
•
! 2
•
!
!
#
# 'A(
1
/74 0
* #
1
#
1
[email protected]
'G(
'5(
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
;
##
*
#
*
* *
#
5$
)
' 7
(
+8>&
Memory Move
7
!
B7
#
!
I
#
!
!
!
#
2
!
M
!
7
!
1
!
!
:
!
1
!
1
#
# 1
24
!
!
.1
#
!
!
@
!
!!
#
>5
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
#
#
&
&
&
4
4
$&
,
&
3
$ &/
*
!
&
&
'535(
'535(
$'&
##
3
: 7
1
*
#
#
(1
&
: 7
#!
$%#
K
# #
0
8 #
#
3
7
#
7
#
3
3
7
(
!
# '@
!
1
3
Physical Implementation
Description of the design flow
#
#
#
!
!
→
# $
>- @
25
7@ B
67E
3!
"
!
7@ B 1
C1
!
"
67E
%&%1
7@ B 1
!
1
!
→
# $
"
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
C.
'
!(
'
%&%(
7@ B
'
< 8
'(
*
#
*
"
7 .0@
VERILOG translation
#
1
.,>
#
!
#
%
67E
'= A
# ##
26
!
!
#
7 .0@
*
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
'
*
*
JANUARY 2005
-
7 .0@ #
%)
*
$- )
+8>&
!
3
#
!
#
#
- !
1
%#
#
!535
.9
# J@
'
*
535#
*
#
!
I 'B,(
*
!
#
'.
-
5
$- )
!
+ &
(
5#
27
[email protected]
07/01/05
A VERY SIMPLE MICROPROCESSOR
JANUARY 2005
Conclusion
1
$%#
!
3
#
! #
1
D
3
#
#
3
1
1
!
1
#
References
),+
&
1N
/
01
1E
%
1
B 9%9>%
599D-$%D1,-->14
28
[email protected]
07/01/05