URL
https://opencores.org/ocsvn/t6507lp/t6507lp/trunk
[/] [t6507lp/] [trunk/] [rtl/] [verilog/] [t6507lp_alu.v] - Diff between revs 154 and 156
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 154 |
Rev 156 |
Line 325... |
Line 325... |
{STATUS[C],result} = op1 + op2 + alu_status[C];
|
{STATUS[C],result} = op1 + op2 + alu_status[C];
|
if ((op1[7] == op2[7]) && (op1[7] != result[7]))
|
if ((op1[7] == op2[7]) && (op1[7] != result[7]))
|
STATUS[V] = 1;
|
STATUS[V] = 1;
|
else
|
else
|
STATUS[V] = 0;
|
STATUS[V] = 0;
|
|
$display("op1 + op2 + C = result + C (V)");
|
|
$display("%d + %d + %b = %d + %b (%b)", op1, op2, alu_status[C],result,STATUS[C],STATUS[V]);
|
|
|
if (alu_status[D] == 1) begin
|
if (alu_status[D] == 1) begin
|
if (result[3:0] > 9) begin
|
if (result[3:0] > 9) begin
|
result = result[3:0] + 6; // A = A - 10 and A = A + 16
|
result = result[3:0] + 6; // A = A - 10 and A = A + 16
|
end
|
end
|
Line 351... |
Line 353... |
end
|
end
|
|
|
// EOR - Exclusive OR
|
// EOR - Exclusive OR
|
EOR_IMM, EOR_ZPG, EOR_ZPX, EOR_ABS, EOR_ABX, EOR_ABY, EOR_IDX, EOR_IDY : begin
|
EOR_IMM, EOR_ZPG, EOR_ZPX, EOR_ABS, EOR_ABX, EOR_ABY, EOR_IDX, EOR_IDY : begin
|
result = A ^ alu_a ;
|
result = A ^ alu_a ;
|
|
$display("op1 ^ op2 = result");
|
|
$display("%d ^ %d = %d", op1, op2, result);
|
end
|
end
|
|
|
// LDA - Load Accumulator
|
// LDA - Load Accumulator
|
// LDX - Load X Register
|
// LDX - Load X Register
|
// LDY - Load Y Register
|
// LDY - Load Y Register
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.