S
s.subbarayan
Dear all,
I have one peculiar problem with me for which I need ur inputs how
to implement it:
I have 2 registers each 8 bit wide.
The first register stores:
Register Map:
________________________________ Can be zero or 1.
|
0 0/1 N10 N9 N8 N7 N6 N5-Reg1
N4 N3 N2 N1 0 1 0 0 -Reg2 For other then N10 to N1 values in bits
are constants.
Now the problem is I have calculated value of N and when N is
expressed in binary in 10 bits,I will get N10-N1 bits.How to fill them
in this registers?
What sort of binary arithmetic should I use to fill the details in
this registers. Can some one let me know some logic to do this in a
efficient manner?
What sort of datatype is suitable to store N ?Which type of data will
make it more efficient in storing?
One more problem here is I want to give user the freedom to change
value of 2nd bit(shown as 0/1 in register map above).How to achieve
this in code?
expecting ur reply and advanced thanks,
Regards,
s.subbarayan
I have one peculiar problem with me for which I need ur inputs how
to implement it:
I have 2 registers each 8 bit wide.
The first register stores:
Register Map:
________________________________ Can be zero or 1.
|
0 0/1 N10 N9 N8 N7 N6 N5-Reg1
N4 N3 N2 N1 0 1 0 0 -Reg2 For other then N10 to N1 values in bits
are constants.
Now the problem is I have calculated value of N and when N is
expressed in binary in 10 bits,I will get N10-N1 bits.How to fill them
in this registers?
What sort of binary arithmetic should I use to fill the details in
this registers. Can some one let me know some logic to do this in a
efficient manner?
What sort of datatype is suitable to store N ?Which type of data will
make it more efficient in storing?
One more problem here is I want to give user the freedom to change
value of 2nd bit(shown as 0/1 in register map above).How to achieve
this in code?
expecting ur reply and advanced thanks,
Regards,
s.subbarayan