Even if I do something less like 13:
S: 0000010001001101
1: 1111101110110010
2: 0000010001001110
When it should be:
S: 0000000000001101
1: 1111111111110010
2: 0000000000001110
Type: Posts; User: mightymouse3062
Even if I do something less like 13:
S: 0000010001001101
1: 1111101110110010
2: 0000010001001110
When it should be:
S: 0000000000001101
1: 1111111111110010
2: 0000000000001110
I guess the next question is what is the proper way to convert from a string to an int.
Example:
I enter this random number: 0001010101100111
It should output this:
S: 0001010101100111
1:...
The result from that is 4*8, which is 32.
The problem I am working on wants 16 bits.
So, am I on the right track with doing the sign/magnitude, ones complement, and twos complement for doing the...
How can I tell if it is signed bits and if it is 16 or 32bit integers?
Thanks,
Mike
I read the cprogramming.com bitwise tutorial and it helped me a bit... I hope.
Below is updated code for what I think I have figured out.
I have a feeling that in using int I am getting some kind...
Here is what I have so far... I check it to make sure all of the arguments are there, then convert it to binary, then display. The problem I am having is converting everything to binary and then...
input (in terminal): ./mynumber hex -2D
output:
Sign/Mag: 1000000000101101
1's: 1111111111010010
2's: 1111111111010011
How do I calculate the output in C?
Thanks,
Mike
Good Morning,
I am working on a project for school that requires me to compute binary numbers and I am having trouble with it. It needs to be able to handle an input of binary, octal, decimal, and...