473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Binary signed numbers

Hello all!
I'm having a little problem with binary numbers. The teacher didn't quite explain them to us (saying we won't need them during the course I'm currently taking). But I know they are very important, especially for courses later on.
I pretty much understood all the basic binary arithmetics such as addition, substraction, etc..
I just have a problem when it comes to the 1's complement of signed binary numbers. For example, if I have +3 written over 4 bits 0011, what is the notation (or respresentation maybe? I don't take the course in english so I don't know the write term for it) of 1's complement? Our teacher told us that is the same as +3, so the 1's complement of +3 is also 0011 for example. And he told us that the 1's complement notation of -3 is the 1's complement of +3 thus is 1100.

If this is wrong, then can someone please explain to me how to obtain the 1's complement of a positive and negative number?
Thank you in advance for all those who answer ^__^
Feb 21 '08 #1
2 1249
Ganon11
3,652 Expert 2GB
This site may be able to explain one's complement representation of numbers. I'm not too sure - I've learned Two's complement representation, which seems much, much easier.
Feb 21 '08 #2
Ok, I have read the site, and I have also asked some friends of mine that took the course before I did. I think I pretty much got them right. If we have a signed number, for example +3 over 5 bits 00011, the 1's complement of that number is 11100 which is also -3. If we need the representation of 1's complement for -3, 10011, we use the positive number 00011, and get it's 1's complement. Is that pretty much it?
Thanks again for your help :)
Feb 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: Christian Stigen Larsen | last post by:
A signed int reserves one bit to signify whether a number is positive or negative. In light of this, a colleague asked me whether there existed an int in C++ that was -0, a zero with the negative...
4
by: Delali Dzirasa | last post by:
Does anyone know of the fastest way to convert a CString of numbers ie "00000001" to the binary representation in an int? for example CString myVal = "00000001"; int myIntVal = 0; ...
14
by: Steven T. Hatton | last post by:
I'm trying to write a program like hexel. I guess I could fish out the source for hexel and look at that, but for now I'm trying to figure out how I can do with with std::stringstream and...
8
by: bearophileHUGS | last post by:
Hello, I have four things to ask or to suggest, sorry if they seem basic or already discussed. ------------------- I am still ignorant about Tkinter. This little program, after pressing the...
9
by: PengYu.UT | last post by:
Hi, I write the content of a in file "data" (in Sun Machine). Then I read "data" in both SunOS and linux. But the result is different. Do you know how to make it binary data portable. Best...
16
by: Dave | last post by:
Hi all, I have a 4 byte char array with the binary data for two 16-bit signed integers in it like this: Index 3 2 1 0 Data Bh Bl Ah Al Where Bh is the high byte of signed 16-bit...
4
by: Freddy Coal | last post by:
Hi, I'm recovery data from an spectrum analizer, the equipment send me data in binary, each data in the trace have 4 bytes, I would like convert that to double, how make that?. I'm trying...
3
by: zgfareed | last post by:
My program converts decimal numbers from to binary and hexadecimal. I am having trouble with my output which is supposed to be in a certain format. Binary needs to be in the format of XXXX XXXX...
2
by: shalombizal | last post by:
I am a student of Electrical Engineering I want to write a C++ program to realize arthimetic operation in binary. can any body help me by giving C++ code for signed mulitplication and Division of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.