tiny cpu – data path (2b) · 4/22/2016  · a copy of the license is included in the section...

28
Young Won Lim 4/23/16 Tiny CPU – Data Path (2B)

Upload: others

Post on 11-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Young Won Lim4/23/16

Tiny CPU – Data Path (2B)

Page 2: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Young Won Lim4/23/16

Copyright (c) 2014 - 2016 Young W. Lim.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Please send corrections (or suggestions) to [email protected].

This document was produced by using OpenOffice and Octave.

Page 3: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 3 Young Won Lim4/23/16

Acc IR

Data Path

Add/Sub

PC

MAR

MDR

Z

pcl

pcinc

mmx mal

mdil

mdol

irlacclcla

intrs

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

mdi

mem_w wr

1

0

mdo

Page 4: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 4 Young Won Lim4/23/16

Instruction Set Architecture

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

001ADD

010STR

011CLA

101JNZ

111RST

OP code

M

M

M

ADD $M ; ACC ← ACC + [M]

STR $M ; [M] ← ACC

CLA ; ACC ← 0

JNZ $M ; PC ← [M] if Z=0

RST ; PC ← 0

Variable Length

M: Operand Address

Page 5: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 5 Young Won Lim4/23/16

Data Path (IF: S1, S2, S3)

Data Path (ADD: A1, A2, A3, A4, A5)

Data Path (STR: T1, T2, T3, T4)

Data Path (CLA, A1)

Data Path (JNZ, J1, J2, J3)

Data Path (RST, R1)

Page 6: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 6 Young Won Lim4/23/16

Acc IR

Data Path (IF, S1)

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

mem_w

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MAR ← PC; MEM_RD;

MDRo

imdil

PC

CK

MAR

S1

wrwr RD

mmx,

mal

1

0

Page 7: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 7 Young Won Lim4/23/16

Data Path (IF, S2)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MDR ← MEM; PC ← PC+1;

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

PC

CK

MEM

S2

MDR mem_w wr

mdil,

pcinc,

1

0

Page 8: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 8 Young Won Lim4/23/16

Data Path (IF, S3)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

IR ← MDR

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

MDR

CK

IR

S3

mem_w wr

irl

1

0

Page 9: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 9 Young Won Lim4/23/16

Data Path (IF: S1, S2, S3)

Data Path (ADD: A1, A2, A3, A4, A5)

Data Path (STR: T1, T2, T3, T4)

Data Path (CLA, A1)

Data Path (JNZ, J1, J2, J3)

Data Path (RST, R1)

Page 10: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 10 Young Won Lim4/23/16

Data Path (ADD, A1)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MAR ← PC; MEM_RD

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

PC

CK

MAR

S4

wr RD

mem_w wr

mmx, mal

1

0

Page 11: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 11 Young Won Lim4/23/16

Data Path (ADD, A2)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MDR ← MEM; PC ← PC+1

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

MEM

CK

MDR

S5

PC

mem_w wr

mdil, pcinc,

1

0

Page 12: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 12 Young Won Lim4/23/16

MDR

Data Path (ADD, A3)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MAR ← MDR; MEM_RD

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdil

mdol

irlacclcla

intrs

o

i

MDR

CK

MAR

S6

wr RD

mem_w wr

mal

1

0

Page 13: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 13 Young Won Lim4/23/16

Data Path (ADD, A4)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MDR ← MEM;

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

MEM

CK

MDR

S4

mem_w wr

mdil

1

0

Page 14: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 14 Young Won Lim4/23/16

Data Path (ADD, A5)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

ACC ← ACC + MDR;

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

ACC

CK

MDR

S8

mem_w wr

accl

1

0

Page 15: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 15 Young Won Lim4/23/16

Data Path (IF: S1, S2, S3)

Data Path (ADD: A1, A2, A3, A4, A5)

Data Path (STR: T1, T2, T3, T4)

Data Path (CLA, A1)

Data Path (JNZ, J1, J2, J3)

Data Path (RST, R1)

Page 16: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 16 Young Won Lim4/23/16

Data Path (STR, T1)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MAR ← PC; MEM_RD

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

PC

CK

MAR

S4

wr RD

mem_w wr

mmx, mal

1

0

Page 17: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 17 Young Won Lim4/23/16

Data Path (STR, T2)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MDR ← MEM; PC ← PC + 1

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

MEM

CK

MDR

S5

PC

mem_w wr

mdil, pcinc

1

0

Page 18: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 18 Young Won Lim4/23/16

Data Path (STR, T3)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MAR ← MDR; MDR ← ACC

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

ACC

CK

MDR

S6

MAR

mem_w wr

mal, mdol

1

0

Page 19: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 19 Young Won Lim4/23/16

Data Path (STR, T4)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MEM_WR;

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

MAR

CK

MDR

S7

wr WR

mem_w wr

mem_w

1

0

Page 20: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 20 Young Won Lim4/23/16

Data Path (IF: S1, S2, S3)

Data Path (ADD: A1, A2, A3, A4, A5)

Data Path (STR: T1, T2, T3, T4)

Data Path (CLA, A1)

Data Path (JNZ, J1, J2, J3)

Data Path (RST, R1)

Page 21: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 21 Young Won Lim4/23/16

Data Path (CLA, C1)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

ACC ← “00”

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

00ACC

CK

S4

mem_w wr

cla

1

0

Page 22: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 22 Young Won Lim4/23/16

Data Path (IF: S1, S2, S3)

Data Path (ADD: A1, A2, A3, A4, A5)

Data Path (STR: T1, T2, T3, T4)

Data Path (CLA, A1)

Data Path (JNZ, J1, J2, J3)

Data Path (RST, R1)

Page 23: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 23 Young Won Lim4/23/16

Data Path (JNZ, J1)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MAR ← PC; MEM_RD;

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

PC

CK

MAR

S1

wr RD

mem_w wr

mmx, mal

1

0

Page 24: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 24 Young Won Lim4/23/16

Data Path (JNZ, J2)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

MDR ← MEM; PC ← PC + 1

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

MEM

CK

MDR

S5

PC

mem_w wr

mdil, pcinc

1

0

Page 25: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 25 Young Won Lim4/23/16

Data Path (JNZ, J3)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

If (Z=='0') PC ← MDR;

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

MDR

CK

PC

S6

mem_w wr

pcl

1

0

Page 26: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 26 Young Won Lim4/23/16

Data Path (IF: S1, S2, S3)

Data Path (ADD: A1, A2, A3, A4, A5)

Data Path (STR: T1, T2, T3, T4)

Data Path (CLA, A1)

Data Path (JNZ, J1, J2, J3)

Data Path (RST, R1)

Page 27: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Data Path (2B) 27 Young Won Lim4/23/16

Data Path (RST, R1)

Based on http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf

PC ← “00”;

Acc IR

Add/Sub

PCMAR

Z

pclpcinc

mmx mal

mdol

irlacclcla

intrs

MDRo

imdil

00PC

CK

S4

mem_w wr

intrs

1

0

Page 28: Tiny CPU – Data Path (2B) · 4/22/2016  · A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions)

Young Won Lim4/23/16

References

[1] http://en.wikipedia.org/[2] http://www.ele.uri.edu/Courses/ele306/f01/Tinydoc.pdf