18.04.2014 Views

Adobe PDF - Edwardbosworth.com

Adobe PDF - Edwardbosworth.com

Adobe PDF - Edwardbosworth.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 15 Boz–7 Implementation of the CPU<br />

In the next table, we examine these instructions closely to determine patterns that will be of<br />

use in defining the Major State Register. For all other instructions, the state after Fetch is<br />

Fetch again; the instruction <strong>com</strong>pletes execution in one major cycle and the next is fetched.<br />

IR 31 IR 30 IR 29 IR 28 IR 27 IR 26 = 0 IR 26 = 1<br />

GET 0 1 0 0 0 Execute<br />

PUT 0 1 0 0 1 Execute<br />

RET 0 1 0 1 0 Execute<br />

RTI 0 1 0 1 1 Execute<br />

LDR 0 1 1 0 0 Execute Defer<br />

STR 0 1 1 0 1 Execute Defer<br />

JSR 0 1 1 1 0 Execute Defer<br />

BR 0 1 1 1 1 Execute if Branch = 1,<br />

Fetch Otherwise<br />

Defer if Branch = 1,<br />

Fetch Otherwise<br />

We define two generated control signals, S 1 and S 2 , as follows:<br />

1. If the present state is Fetch and S 1 = = 0, the next state will be Fetch.<br />

If the present state is Fetch and S 1 = = 1, the next state is either Defer or Execute.<br />

2. If the present state is Fetch, S 1 = = 1, and S 2 = = 0, the next state will be Execute.<br />

If the present state is Fetch, S 1 = = 1, and S 2 = = 1, the next state will be Defer.<br />

3. Automatic rule: If the present state is Defer, the next state will be Execute.<br />

4. Automatic rule: If the present state is Execute, the next state will be Fetch.<br />

This leads to the following state diagram for the Major State Register.<br />

Figure: State Diagram for the Major State Register<br />

A three–state diagram requires two flip–flops for its implementation. To begin this design,<br />

we assign two–bit binary numbers, denoted Y 1 Y 0 , to each of the major states.<br />

State Y 1 Y 0<br />

F 0 0<br />

D 0 1<br />

E 1 0<br />

Page 526 CPSC 5155 Last Revised July 9, 2011<br />

Copyright © 2011 by Edward L. Bosworth, Ph.D. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!