jakilax
Newbie level 5
- Joined
- Feb 20, 2013
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,355
Hey guys, I was wondering if someone could give me a hand with designing a specific ALU.
Here is what I would like to implement:
- sequentlial unit with 2 registers (e.g. Acc and Data_Reg)
- immediate Read and Write Access to Acc
- 4 funtion bits (S01 - S03) to select an OpCode (see table below)
- ALU should flag for Acc = 0 (CPZ), for overflow (OVR) and for Acc = Data_Reg (AED)
S01 S02 S03 S04
0......0......0......0......RES RESET Acc to 00000000 (Arith)
0......0......0......1......INC Acc = Acc + 1 (Arith)
0......0......1......0......ADD Acc = Acc + Data_Reg (Arith)
0......0......1......1......SUB Acc = Acc - Data_Reg (Arith)
0......1......0......0......MUL Acc = Acc x Data_Reg (Arith)
0......1......0......1......SHL Acc = Acc shifted left (up) by Data_Reg bits
0......1......1......0......SHR Acc = Acc shifted right (down) by Data_Reg bits
0......1......1......1......AND Acc <= Acc NAND Data_Reg (Logic)
1......0......0......0......XOR Acc <= Acc EXOR Data_Reg (Logic)
1......0......0......1......SET SET Acc to 11111111 (Arith)
1......0......1......0......LDA Load Acc from Data RAM (Cntrl)
1......0......1......1......LDD Load Data_Reg from Data RAM (Cntrl)
1......1......0......0......STA Store Acc to Data RAM (Cntrl)
1......1......0......1......STE Store External Data to Data RAM (Cntrl)
1......1......1......0......INZ Increment PC if ZFL = '1' (Cntrl)
1......1......1......1......JMP Jump to P(x)C if ZFL = '1' (Cntrl)
any help would be highly appreciated xx
Here is what I would like to implement:
- sequentlial unit with 2 registers (e.g. Acc and Data_Reg)
- immediate Read and Write Access to Acc
- 4 funtion bits (S01 - S03) to select an OpCode (see table below)
- ALU should flag for Acc = 0 (CPZ), for overflow (OVR) and for Acc = Data_Reg (AED)
S01 S02 S03 S04
0......0......0......0......RES RESET Acc to 00000000 (Arith)
0......0......0......1......INC Acc = Acc + 1 (Arith)
0......0......1......0......ADD Acc = Acc + Data_Reg (Arith)
0......0......1......1......SUB Acc = Acc - Data_Reg (Arith)
0......1......0......0......MUL Acc = Acc x Data_Reg (Arith)
0......1......0......1......SHL Acc = Acc shifted left (up) by Data_Reg bits
0......1......1......0......SHR Acc = Acc shifted right (down) by Data_Reg bits
0......1......1......1......AND Acc <= Acc NAND Data_Reg (Logic)
1......0......0......0......XOR Acc <= Acc EXOR Data_Reg (Logic)
1......0......0......1......SET SET Acc to 11111111 (Arith)
1......0......1......0......LDA Load Acc from Data RAM (Cntrl)
1......0......1......1......LDD Load Data_Reg from Data RAM (Cntrl)
1......1......0......0......STA Store Acc to Data RAM (Cntrl)
1......1......0......1......STE Store External Data to Data RAM (Cntrl)
1......1......1......0......INZ Increment PC if ZFL = '1' (Cntrl)
1......1......1......1......JMP Jump to P(x)C if ZFL = '1' (Cntrl)
any help would be highly appreciated xx
Last edited: