The positive values are easy: 0 = 0000 1 = 0001 2 = 0010 3 = 0011 4 = 0100 5 = 0101 6 = 0110 7 = 0111 For the negative values, you need the 2's complement (invert all the bits, then add "1") -1 = 1110 + 1 = 1111 -2 = 1101 + 1 = 1110 -3 = 1100 + 1 = 1101 -4 = 1011 + 1 = 1100 -5 = 1010 + 1 = 1011 -6 = 1001 + 1 = 1010 -7 = 1000 + 1 = 1001 The only combination not yet used in either positive or negative values is "1000" This could equal either 8 or -8, so in keeping with the sign bit convention, -8 is used. So, signed 4-bit binary gives you the values -8 to 7. Similarly, signed 8-bit binary give you -128 to 127 and signed 16-bit binary give -32768 to 32767.
I liked the small examples & summary slides. Also liked how you threw in other information like: - "keep in mind it is up to you the programmer to specify how any given binary sequence is going-to be interpreted" ... In the comments below someone mentioned 2's compliment, which is something I'd heard mentioned in the past, but never really looked into. Essentially there are several ways to represent signed numbers (positive or negative numbers). One method is by using the signed magnitude method ( using a sign bit ..shown in this video) and complement form (1 & 2s complement)
What happens is that rather than counting a positive zero and a negative zero, you get one extra negative number. For example, a 16 bit signed integer would hold values from -32,768 to positive 32,767.
*Excellent!* I was having problems understanding this but I practiced binary exorcises converting binary to decimal and hexadecimal, or converting hexadecimal to decimal and binary etc. Now I completely understand all that was said in the video.
Why do most Computer Tutorials sound like there's some Huge Ass Server running in the background? Lol. Thank you so much for this video! This is so easy to understand with your instructions. Subbed!
So why would TH-cam use a signed 32-bit integer to represent the total number of views for a video instead of an unsigned integer? When would they ever need to record a negative number of views? There must have been some benefit of using a signed integer but I can't imagine what that would be.
hmm, well, unsigned integer would only delay the problem of the max view limit. Upgrading to 64 bit is just the logical next step to do, but ofc - yes, they could use unsigned integer, and have the view-counts run for many more years with only positive numbers to display.
This is an excellent video. You might want to look into Nvidia broadcast or something like that for background noise canceling. If it didn't have that background noise this video would be A+
For those of you confused as I was, the reddit thread has explained it in comments. For those of you starting this after me, you'll have figured out I'm following reddit and youtube as I go. www.reddit.com/r/carlhprogramming/comments/9os31/lesson_18_the_basics_of_signed_and_unsigned/
Literally no one is talking about how terrible of a person this guy was! Like yeah, this video might have helped you learn something, but he was a maniac, so keep your praise to yourself.
@@radiagulzan omg this is crazy. But it reminds me of something my philosophy teacher said. A evil person can state facts. Doesn't mean you automatically have to discredit every word from his mouth/ such as facts of whatever he's teaching. You can discredit his character and even be repulsed by it. It's important to separate the two. Although I do hope he gets the punishment he deserves and is put in jail for life and suffers for such horrendous repulsive crimes. However his video is not a crime so I will try to understand this video topic at hand even though I am really disturbed about this person's mental well being now.
Hi Carl, A little question about the signed numbers, what happens to zero? There's no positive nor negative zero, so it means we're wasting four bits for nothing, right? as we're counting twice zero as it can be only one value for zero.
Nearly 9 years after the original upload date, and this still helped me a bunch. Thank you
I like my computer science teacher but gotta admit he is not the clearest lecturer. Your videos are clear, concise, to the point. Thanks SO much.
My classes just skimmed over this real quickly, I thank this video for being avalible for me to better understand this concept. Thank you.
"So I want to explore this a 'bit' more" hehehe
Get out...👉🤣
The positive values are easy: 0 = 0000 1 = 0001 2 = 0010 3 = 0011 4 = 0100 5 = 0101 6 = 0110 7 = 0111
For the negative values, you need the 2's complement (invert all the bits, then add "1")
-1 = 1110 + 1 = 1111
-2 = 1101 + 1 = 1110
-3 = 1100 + 1 = 1101
-4 = 1011 + 1 = 1100
-5 = 1010 + 1 = 1011
-6 = 1001 + 1 = 1010
-7 = 1000 + 1 = 1001
The only combination not yet used in either positive or negative values is "1000" This could equal either 8 or -8, so in keeping with the sign bit convention, -8 is used. So, signed 4-bit binary gives you the values -8 to 7. Similarly, signed 8-bit binary give you -128 to 127 and signed 16-bit binary give -32768 to 32767.
+Amr Farag Excellent clarification, also on the non-duplication of zero. Thanks!
+Amr Farag
اشرح الكلام ده تانى كدا
For the negative values, you need the 2's complement (invert all the bits, then add "1")
-1 = 1110 + 1 = 1111
-2 = 1101 + 1 = 1110
-3 = 1100 + 1 = 1101
-4 = 1011 + 1 = 1100
-5 = 1010 + 1 = 1011
-6 = 1001 + 1 = 1010
-7 = 1000 + 1 = 1001
This is amazing. You just taught me something I couldn't grasp by other teachers.
Awesome teaching style. Super clear, super concise. Thanks!!!
I liked the small examples & summary slides. Also liked how you threw in other information like:
- "keep in mind it is up to you the programmer to specify how any given binary sequence is going-to be interpreted" ...
In the comments below someone mentioned 2's compliment, which is something I'd heard mentioned in the past, but never really looked into.
Essentially there are several ways to represent signed numbers (positive or negative numbers). One method is by using the signed magnitude method ( using a sign bit ..shown in this video) and complement form (1 & 2s complement)
Thanks for this , a video made 10 years ago taught me in 10 mins what a college lecturer failed to do in 4 weeks!
it’s so crazy seeing these comments thanking him not knowing what he did
I went down the rabbit hole… 😧😧😱
10 years down the line and this is still useful
Brooooooooo, This is soooo much more clear than my current professor thank you!!!
What happens is that rather than counting a positive zero and a negative zero, you get one extra negative number. For example, a 16 bit signed integer would hold values from -32,768 to positive 32,767.
i still confuse.............. how i know about number is signed or not
M8 he’s in jail
*Excellent!* I was having problems understanding this but I practiced binary exorcises converting binary to decimal and hexadecimal, or converting hexadecimal to decimal and binary etc. Now I completely understand all that was said in the video.
My professor is an Asian man who speaks terrible english, I can't understand a word he says. This video is very helpful
Thank you! I finally got this bit into my brain.
Why do most Computer Tutorials sound like there's some Huge Ass Server running in the background? Lol.
Thank you so much for this video! This is so easy to understand with your instructions. Subbed!
subbed although he hasn't posted in 6 years XD
@@IFoundAUsername2 www.nydailynews.com/news/crime/alabama-man-raped-videotaped-sonin-interstate-child-porn-ring-prosecutors-article-1.1549914
@@IFoundAUsername2 Would probs unsub
So why would TH-cam use a signed 32-bit integer to represent the total number of views for a video instead of an unsigned integer? When would they ever need to record a negative number of views? There must have been some benefit of using a signed integer but I can't imagine what that would be.
hmm, well, unsigned integer would only delay the problem of the max view limit. Upgrading to 64 bit is just the logical next step to do, but ofc - yes, they could use unsigned integer, and have the view-counts run for many more years with only positive numbers to display.
what is the alternative for representing negative values? and what is compliment?
Why do you get an extra negative and not extra positive number instead? Just a conventional way or does it hold a special purpose?
This is an excellent video. You might want to look into Nvidia broadcast or something like that for background noise canceling. If it didn't have that background noise this video would be A+
OMG thanks alot sir!!! that was perfect explanation
Explained fantastically. Keep it up.
He killed himself
@@luzherrera4463 ?
You are great, i hope you are doing good ❤❤
he dead.
all confusion gone away.
Consider a number line for this concept it will get clear.
some of the people in the comments are getting mixed up between sign and magnitude, using leftmost bit as a sign, and 2's compliment.
thank goodness for your video. Couldn't have been explained more clearly. Thanks very much.
3:12 i want to explore this a "bit" more
I have a doubt,just have u said that if int x=1010,then signed x is -2,it could be +10 also ,as the result should depend on the no. of bits of x.
very nicely explained thank you
Great video. Thank you
Thank you for explaining so well!
explained well.
thank you very much, man.
Awesome man
I get it the idea 💡
really clear
For those of you confused as I was, the reddit thread has explained it in comments. For those of you starting this after me, you'll have figured out I'm following reddit and youtube as I go.
www.reddit.com/r/carlhprogramming/comments/9os31/lesson_18_the_basics_of_signed_and_unsigned/
i see your material ,really helpful where can i find all lessons??
summary: 7:50
Yes, known as 2's complement
This helped me a lot thanks!
8:20 not respectively in this case , inversely as far as i understand
Awesome explanation!
great video
Well, thanks for the video, but..
5:45 binary 0011 is 3, that's okay
But 1011 is actually not negative 3, that's negative 5..
Great Video. Thanks a ton!
Did you hear what he did?
@@TheBatmanvs1 Yes
1011 is also negative three and eleven???
how is this possible? i am totally confused..pls help
yes,that's way you can't know data type just by looking at it 0:35
Literally no one is talking about how terrible of a person this guy was!
Like yeah, this video might have helped you learn something, but he was a maniac, so keep your praise to yourself.
Grant Gammon Wow.... if not for your comment here, I never would have known.
holy shit i just googled his name wtf
omg is this the same person? www.inquisitr.com/1069377/carl-herold-popular-reddit-user-carlh-accused-of-raping-torturing-9-year-old-son/
@@radiagulzan omg this is crazy. But it reminds me of something my philosophy teacher said. A evil person can state facts. Doesn't mean you automatically have to discredit every word from his mouth/ such as facts of whatever he's teaching. You can discredit his character and even be repulsed by it. It's important to separate the two. Although I do hope he gets the punishment he deserves and is put in jail for life and suffers for such horrendous repulsive crimes. However his video is not a crime so I will try to understand this video topic at hand even though I am really disturbed about this person's mental well being now.
@@pjk7685 Thank you for bringing that up. This is insane!! I am only here to learn about this certain topic but it gave me the chills.
best best
thanks i was trying to understand it
is there any android code pads available ...!? plz someone answer's me
and for 32 bit complir it is ??????
Actually my bad, this is sign magnitude. But i generally like 2's complement better.
Thank you. Even though this is still a little confusing it helped.
He’s literally been dead for like 6 years
@@theanimationlads7598 . I didn't know. After you said that I decided to Google his name. I can't believe what I read.
Thanks a lot
Very awesome!
it's great.
perfect thank you
well explained
how do you know what number it is?
He ain't gonna reply chief. My nigga is burning in hell.
@@RayGBullet yo it's been 6months lmao dont even remember this video just glad I passed the semester 😩
@@nawal7254 Hey are u somali?
@@aishamohammed5628 Sudanese
Lmao a year now 😂
thanks, good to know
3:10 Nice pun sir...
¡EXCELENT! ¡Thanks!
Awesome!
Awesome
Excelent!!!!!!
isn't 1111 negativ 0?
no.. itz a negative 7
good vid but get rid of all the background noise
Lol really?
Playback speed 2x
also 1010 is NOT negative two!
it looks more like negative six to me.
It's negative 2 in signed number..
The first bit is reserved for the sign
"this number is obviously 7" :"0
#dickgamestrong
NNEERRRRRRDSS
Hi Carl,
A little question about the signed numbers, what happens to zero? There's no positive nor negative zero, so it means we're wasting four bits for nothing, right? as we're counting twice zero as it can be only one value for zero.
I don’t think he’s going to respond any time soon
@amps sup
I see, so you basically skip the negative zero and start counting right away from -1 to -32768?
Cool, no bits waste...
Awesome teaching style. Super clear, super concise. Thanks!!!
look up his name, you'd be surprised...