Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ABEL 3-bit ALU

Status
Not open for further replies.

BSOD2600

Technical User
May 26, 2003
9
US
I need help/resources to accomplish the following task, which I haven’t the slightest idea how to do.

Design an ALU (3 bit) for and XYZ MPU device using ABEL or schematic capture that meets the following specifications:
1. the ALU has two 3-bit input busses for Operand Data AI: (AI0 ->AI2) and BI: (BI0->BI2).
2. The ALU has Two Inputs INS0 and INS1 that define the Instruction Operation as given above.
3. The ALU has a single 3-bit Output bus OUT: (OUT0 ->OUT2) that has the result of the Instruction Operation and COUT for Carry/Barrow. You man need to use intermediate carries (C0, C1, for the add/subtract operations).

Chip used: GAL16V8
THANKS!

This is what I've gotten so far...I can figure out division or multiplicaton.


MODULE threebitALU
title '3-bit ALU'

a2..a0 pin;
b2..b0 pin;
ins0, ins1 pin;
out2..out0 pin istype 'com';
cout pin istype 'com';
cin pin;
c2..c0 node istype 'com';

ins=[ins1,ins0];
out=[out2..out0];
a=[a2..a0];
b=[b2..b0];

equations
WHEN (ins==0) THEN
{
out0=a0$b0;
c0=cin&(a0$b0)#(a0&b0);
out1=a1$b1$c0;
c1=c0&(a1$b1)#(a1&b1);
out2=a2$b2$c1;
c2=c1&(a2$b2)#(a2&b2);
cout=c2&(a2$b2)#(a2$b2);
}

WHEN (ins==1) THEN
{
out = a$b
}

WHEN (ins==2) THEN
{
out = a&b;
// out1 = a1&b1;
// out2 = a2&b2;
}

WHEN (ins==3) THEN
{
out0 = a0#b0;
out1 = a1#b1;
out2 = a2#b2;
}

test_vectors([ins,b,a]->[out,cout])
[0,0,0]->[0,0];
[0,0,1]->[1,0];
[0,1,0]->[1,0];
[0,1,1]->[2,0];
[0,2,2]->[4,0];
[0,3,3]->[6,0];
[0,4,4]->[8,0];
[0,4,5]->[1,0];
[1,1,1]->[0,0];
[1,1,3]->[2,0];
[1,2,6]->[4,0];
[2,0,0]->[0,0];
[2,1,0]->[0,0];
[2,1,1]->[1,0];
[2,2,2]->[4,0];
[2,2,1]->[2,0];
[2,1,3]->[3,0];
[3,2,2]->[1,0];

END
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top