Paminu
Guest
|
Posted:
Fri Aug 05, 2005 12:15 am Post subject:
SLT with Overflow Detection |
|
|
I have tried to make overflow detection logic when a SLT instruction is
made.
The way I have designed it, its only the two most significant bits (inA,
inB) and the carryin (cIn) that needs to be checked.
Based on the possible values from these 3 inputs I have made the following
boolean expression where: "*"= OR, "+" = AND, "~" = negation
(inA + ã + cIn) * (~b + a + ~cIn) = Overflow
based on this truth table:
inB inA cIn | Overflow
1 1 1 | 0
1 1 0 | 0
1 0 1 | 1 * Overflow occurs
1 0 0 | 0
0 1 1 | 0
0 1 0 | 1 * Overflow occurs
0 0 1 | 0
0 0 0 | 0
I make the signal from the overflow detection go into a mux. When overflow
occurs the select bit is 1 and I drive 0 (SLT = 0 when a < b = false). If
overflow detection sends a 0 I just choose the normal value from the latest
ALU.
I have made a few test but hope someone will be able to see if there is
something wrong with it.
Pictures at:
http://bigblop.blogspot.com/ |
|