M
Manuel
Guest
Hello,
I'm a student. I must realize a simple ALU with two register (16 bit)as
input and one register (16 bit)as output. The problem is the ALU in the
middle.
Input:
In_A(15:0)
In_B(15:0)
alu_op(3:0)
carry_in
Output:
alu_out(15:0)
z (flag of zero)
v (flag of overflow)
c (carry out)
n (signum of result)
alu_op has different configuration (e.g:0000 --> move a to output)
I have to put the input in vector of 17 bit (OK)
then i have to work on them and I have the result (in vector of 17
bit):in this way the first bit is carry out and the second is signum.
How can implement
1) a_decrement and
2) SBC (sub with carry)and
3) ADC (add with carry)?
4) how could use the bit for overflow?
I had a solution but i would compare it. I think:
1) a + "1111111111111111"
2) a-b+carry_in
3) a+b+carry_in or a+b+"100000000000000000"
4) maybe second bit?
I'm talking at logic level.
Thanks
Manuel
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
I'm a student. I must realize a simple ALU with two register (16 bit)as
input and one register (16 bit)as output. The problem is the ALU in the
middle.
Input:
In_A(15:0)
In_B(15:0)
alu_op(3:0)
carry_in
Output:
alu_out(15:0)
z (flag of zero)
v (flag of overflow)
c (carry out)
n (signum of result)
alu_op has different configuration (e.g:0000 --> move a to output)
I have to put the input in vector of 17 bit (OK)
then i have to work on them and I have the result (in vector of 17
bit):in this way the first bit is carry out and the second is signum.
How can implement
1) a_decrement and
2) SBC (sub with carry)and
3) ADC (add with carry)?
4) how could use the bit for overflow?
I had a solution but i would compare it. I think:
1) a + "1111111111111111"
2) a-b+carry_in
3) a+b+carry_in or a+b+"100000000000000000"
4) maybe second bit?
I'm talking at logic level.
Thanks
Manuel
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG