How about Stackimal (base 64) or hexadecahexadecimal (base 256)?
@wojciechjaworski6024 жыл бұрын
Two 7-segments displays are enough to show the entire byte in hex and value is more readable than 8 LEDs connected to port. Good for debugging purposes in electronics, some motherboards have them to print POST codes
@mshingote4 жыл бұрын
Your channel has very rich content. The quality of the videos, your presentation skill is really nice.
@cellmaker13 жыл бұрын
What a clear and very useful explanation of when and why to use Hex! Thanks.
@jimnoeth3040 Жыл бұрын
Great job explaining hex and why to use it. The first mainframe I programmed on was a GE 6000 series that had a 36 bit word (IBM used 36 bit words in their early computers too). The words were divided into upper and lower of 18 bits each. Base 8 or octal worked well in that case, so I got used to octal (or rectal as we sometimes referred to it) to represent the 18 and 36 bit values. Just a piece of history.
@meme-d2h1g5 ай бұрын
Taking David Bombal's CCNA course and this just helped me greatly. Much simpler explanation and now converting to binary is easy, thanks !
@derekkonigsberg20474 жыл бұрын
I have a Computer Science degree and absolutely do know how to use hexadecimal, yet somehow I've never heard the term "hexit" before in my entire life.
@krisboultbee10062 жыл бұрын
Same here. I think the term "nibble" is more common. It's also a pun, which of course programmers love as well. A Nibble is a part of a Byte.
@JacobSorber2 жыл бұрын
Yeah, apparently there are dialects within the CS language. Glad I could expand your vocabulary. 😂
@krisboultbee10062 жыл бұрын
@@JacobSorber That's a good point, even if you didn't really mean it that way (or even if you did). People use different terms for things all the time. So please don't take what I said as dismissal of the term "hexit". It actually makes complete linguistic sense for it to be called that. I've just never come across it.
@JacobSorber2 жыл бұрын
@@krisboultbee1006 No worries. Your comment didn't sound dismissive to me, at all.
@camm409 Жыл бұрын
I had never heard that term either but it made complete sense to me, I might rob the usage of that term to explain it to others.
@Maha_s19992 жыл бұрын
Fantastic summary! Hexadecimal numbers here I come, thanks for the heads up Jason!!
@KaspianBerheimBrudin-ny4ge4 ай бұрын
If you channel a 4-bit number through a 4bit decoder and then set the appropiate bits for a 7segment display, you can show a binary number in hex. Super easy to expand.
@MickZeller4 жыл бұрын
I'm digging the goatee look! Great video, as usual, thanks for putting it together!
@thomasmurphy46404 жыл бұрын
Great timing for this video. I just start programming with hexadecimal numbers at my job.
@johnjackson34832 жыл бұрын
Sir(the respectful part) One place you will find binary in code is Ben Eater’s video on sending commands to an LCD display in C code to set register commands to set all pins to output. He says “I could use oXFF but so you can visualize it I’ll use %”11111111” to set all pins to input. Enjoying your videos.
@Jenny_Digital2 жыл бұрын
I’ve been familiar with and using hex numbers since 1982-3 when dad bought us a ‘family’ home computer. It was an Acorn Electron with a built in assembler and I wore my first code on it. Sweet times! Seriously though, hex numbers are useful and make things easier _some_ of the time. Didn’t find it funny however when reading a datasheet for an old GI part, they used a few octal numbers without telling me they were such. Took me ages to realise what was wrong.
@JacobSorber2 жыл бұрын
Yeah, that's pretty mean.
@Jenny_Digital2 жыл бұрын
Also, having heard you mention not seeing all that much binary in code, I found it much more useful when going straight to the metal back in the day than now. Somehow it made more sense with some registers and whatnot in 6502 and back then. Thank goodness for good compilers now though!
@anandjoshua4711 Жыл бұрын
Very useful video, I wish I had come across this sooner.
@odpisani9814 жыл бұрын
Great video as always! Thanks for sharing your knowledge with us. :)
@tymothylim65502 жыл бұрын
Thank you Jacob for this video. Helps clarify things for me :)
@rustycherkas82292 жыл бұрын
@07:15 "Favourite uses for hex?" Sending messages to NASA if/when I'm ever marooned on Mars... 👽 🤣🤣🤣🤣🤣
@ColinBroderickMaths Жыл бұрын
I get alone fine with hex but I often prefer the binary notation (like 0b01101001) for masks because I can immediately tell which bits are affected with exactly zero thought. That notation is now standard in both C and C++, I believe. Naturally if you're dealing with 32-bit masks, or something large like that, it becomes a lot less convenient!
@ABaumstumpf4 жыл бұрын
Reminds me of a bug that took me ages to find and fix. For printing documents the event has a field for the document-type - so far so easy. That field is a hand written bit-set (well, mostly typedef and several defines and macros.... no, this is C++14,,,, ) but ok, and the mask for that was from an enum. And there in lied the problem - the enum was written with decimal numbers (of course partially from other defines and enums again) and somebody added a new document-type but just gave it another new integer - not a power of 2. And to make matters worse the function that mapped a given document-type-field to the actual documents was not a simple lookup but had an internal state and, given the same document-type-field again, returns the NEXT BIT that is set - a relic from when the bit-field was used for other things. So as long as you had only power-of-2 numbers it worked, if you had a number like 66 then the first time you checked it would give you the document corresponding to the enum for 64 and the second time it would be 2......................... which meant that when you tried to compare a document-type to it self it could return not-equal because of that -.-
@amirvejahat95665 ай бұрын
Great explanation!
@Rakusan22 жыл бұрын
When I was learning C, I already knew hex from languages I learned before and so it did not bother me. On the other hand, octal did. It was mainly because I had never seen it before and at first look, I thought it was hex.
@ΑλέξηςΝικολαΐδης-η6ο4 жыл бұрын
I'm familiar with hex, but I haven't understood something yet. Why does the 0* exist? For ex: 0*F63A. Why don't we just write F63A?
@homelessrobot3 жыл бұрын
the 0x or 0h convention is to make distinguishing numbers from other symbols easier; if a token starts with a digit; the token represents some kind of number. Otherwise you have to do more complex parsing to even identify what the role of a symbol is. And the x is used two distinguish between overlapping numerical representations: 0123; is it decimal? Is it octal? Is it hex? You cannot tell just by looking at it. All of those digits are valid in all three representations.
@rustycherkas82292 жыл бұрын
Consider how the parser deals with sequential characters in a C source file. An alphabetic character suggests a symbol is starting. (Eg: in "xyz = 5;" the 'xyz' is a variable name starting with letter 'x'.) A leading digit means that what follows is a number. (Eg: "x = 3.14159;" the '3' triggers interpretation as a value.) 27 or 345 or 1024 would each be recognised as decimal integer values. Long ago, octal was more popular, and a leading 0 meant the value was octal, not decimal. (UNIX & C were developed on DEC PDP computers whose internals and machine code instruction set 'fit' with octal numbering.) 077(base 8) is the octal representation of 63(base 10). As Hex, that would be 0x3F(base 16). To 'extend' C, the leading 0 has been retained to indicate "non-decimal number", and 'x' was added as 2nd char to indicate "this is hexadecimal, not octal". As to your F63A??? Consider: if( R2D2 < C3P0 )... Your 'F63A' is a valid name (token) for a variable (or a function)... How should the compiler distinguish you mean it to be a number? (Yes, R, P and O are not hex digits... cut me some slack, please!) const int F63A = 0xF63A; 🤣🤣
@ziat19882 жыл бұрын
I don't understand why there's the x in 0x16D? Only letters from A to F are accepted right?
@cybercrimeconsultant2 жыл бұрын
Nice discussion on HEX.
@mnoxman Жыл бұрын
Before the 80s Octal was quite popular too and going back even further BCD.
@JoePescisAngryCousin Жыл бұрын
This video was great. Thank you.
@unclerojelio63203 жыл бұрын
Hexits? I’ve been a programming since the 80’s and that’s a new one on me.
@tahmiddaniel92413 жыл бұрын
I liked your video very much. I learnt a lot about the conversation of numbers. Thanks. But I have a query that (365)2 = (11110101)2 is this correct? Did I make a mistake? Please help me to figure out what error occurred? Advance thanks again.
@TomStorey963 жыл бұрын
If you've done what I think you did, you don't encode each decimal number as it's own string of binary digits and then concatenate them. The binary representation indicates which powers of two add up to make the number. 365(10) = 101101101(2) Or 256+64+32+8+4+1
@igwanwan_dagoat1523 Жыл бұрын
So when you use numbers such as 26 you use more data in the computer?
@chef1arjunaidi3 жыл бұрын
I am surprised you did not mention the HP 16C computer scientist calculator which makes base number calculations a breeze. Sadly, it is no longer in production. However, a Swiss company SwissMicros have produced DM-16, a clone of the venerable HP 16C
@wandersgion49894 жыл бұрын
Anybody ever watch the CGI animated kid's show, Reboot? There's this cool villain in it named Hexadecimal. I guess she must have been really good at counting to 16. I think that show deserves a reboot. 😉
@scottbaldy89562 жыл бұрын
At 3:48 you imply that 45004503 (base 10) = 11010101110101101101101011 (Binary). This is incorrect. The binary number shown equates to 56056683.
@komodot92494 жыл бұрын
I might have missed it ,but I think you forgot to mention big edian vs little edian. That can be really confusing when trying to read data from a binary file when you already know hex.
@davidolsen12222 жыл бұрын
And the endian nature matters a lot. Such that where the individual bytes and sometimes octets end is absolutely critical to understanding the data. A thing that gets much harder to understand if we don't have those boundaries marked by using hex.
@lylewyant33564 жыл бұрын
Been a long time since I've studied hex or octal
@olealgoritme67744 жыл бұрын
Nibble = half a byte Half a byte = 4 bits 8 bits = 1 byte
@lewiscole51934 жыл бұрын
IMHO, you should use hex if that's what the convention(s) is/are for the programming environment you are working in. In today's world, that means you will usually use hex (or decimal or occasionally binary). But if you're an old timer like me who used to work on a 36-bit machine with 6-bit, 9-bit, 12-bit, or 18-bit subunits where it was convention to deal with 3-bit groups, then you will usually use octal (or binary or occasionally binary). IOW, find out what the conventions are and stick to them, not use hex if you can't use binary or decimal.
@gabe92503 жыл бұрын
Now I know how to turn hexadecimal to decimal in my head faster, I know that’s not the purpose of the video but thanks anyway 🙏!
@askr75124 жыл бұрын
Can you please do a video on after effects in embedded field like losses in market, what new we can expect ... etc etc due to corona lockdown on earth...
@leonardoestacio54372 жыл бұрын
How rare though, when I first met hex I fell in love with it, I like it even more than the decimal base, and I code as hobby, am I some type of nerd?
@ancatarca80473 жыл бұрын
love your videos , this was very helpful
@JacobSorber3 жыл бұрын
Thanks, Anca. Glad I could help.
@edgeeffect2 жыл бұрын
DEAD BEEF.... That one of the places Unix and it's friends show their age.... Hex seemed to "win" against Octal sometime around 1980s but Unix still uses Octal in quite a few places.
@jiechen13742 жыл бұрын
3:55 Hex over binary ; 4:30 another advantage
@chiragjethava11864 жыл бұрын
Can you make a video on thread pool explanation using pthread ?
@JacobSorber4 жыл бұрын
Check out my multithreaded server videos. One of them has a thread pool.
@theinvertedworld.2 ай бұрын
for those new to number systems : what happens in hexadecimal, stays in hexadecimals
@44r0n-94 жыл бұрын
I love your videos so much.
@danieleccleston79284 жыл бұрын
Jacob Sorber: Why are you Running!?
@sayanghosh69963 жыл бұрын
2:00 this? what this? where ?
@69k_gold Жыл бұрын
Hex in itself isn't a problem, it's when some insane people write hex numbers in odd number of digits it becomes confusing
@justcurious19402 жыл бұрын
to convert from binary to decimal u multiply each digit with powers of 2 and then u add them together but from binary to hexa u group every 4 bits then u convert them to get 1 hexa digit i know 1 hexa digit can represent what a 4bits can represent but what does not make sense is the way how we convert binary to decimal why we use all bits together and then we add the result of the multiplication of all digits with the powers of 2 why does it work this way ?????????? is base10 an unique base or what ??? please i cant sleep because of this i feel i'm missing something
@JacobSorber2 жыл бұрын
No there's nothing special about base 10. Base 16 is special because it's a power of 2. That's why you can take bits in bundles. So, base 4 and base 8 and base 32 would all have that property. But converting from base 2 to base 5 or base 3 you would end up doing what you're doing with base 2-> base 10.
@justcurious19402 жыл бұрын
@@JacobSorber thank you for answering i'm trying my best to not be a heavy student here conversions from : base 2 -> base 8 base 2 -> base 16 base 2 -> base 32 is very clear to me and also the steps we tak for these conversions make sense what is not clear is conversions from : base 10 -> base 2 base 10 -> base 16 base 10 -> base 3 base 10 -> base x the steps u take to convert base 10 to any other base is the same u only have to change the base value for the target base which mean we can convert base 10 to any other base but we canot for example convert base 2 to base 3 or base 2 to base 5 directly right ? or even convert from hexadecimal to octal directly right ? which mean base 10 is the only base that we can convert any other base to it right ? like u said base 8 and base 16 are specials for base 2 but what about base 10 on general why is it the only base that we can convert any other base to it ?
@JacobSorber2 жыл бұрын
You can convert any base to any other base. We just use base 10 because it's our societal default-it's what we're used to. For example, say I want to convert from base 2 to base 5. Consider the base-2 representation 011010 Normally, we talk about the base-2 places as 1, 2, 4, 8, 16, 32, 64 ... In base 5, they would be 1, 2, 4, 13, 31, 122, 224 So, in base 5, that number would be 2 + 13 + 31 = 101 But, we usually mentally use base 10 as our internal "native" number format. So, people usually convert to base 10 as an intermediate step. But, you definitely don't have to.
@justcurious19402 жыл бұрын
@@JacobSorber thank you so much brother i did play with base 5 a little bit i'm not gonna lie it was tricky with addition and multiplication but i did convert base 2 to base 5 using 1,2,4,13,31,112,224 as a place values and also i managed to convert binary to hexadecimal without grouping digits by using 1,2,4,8,10,20,40,80 instead of using place values in base 10 (hopefully i'm correct in this explanation ) thank u so much i really couldn't get over it in the past few days to a point i started thinking why do we have 10 fingers ? is it related to the 10 digits that we have in base 10 hhhhhhhhh
@PartheevVideoClub3 жыл бұрын
Make a video on Octal decimal
@AnilKumar-hp1qg4 жыл бұрын
Binary is like Traditional Chinese. Hexadecimal is Simplified Chinese, still is excruciatingly difficult to learn.
@ロズマリミルクシワル2 жыл бұрын
I like how HEX is, on average, shorter to write. In DEC, from 100 to 255, everything in HEX is still only 2 characters while DEC is 3 now.
@ninesquared81 Жыл бұрын
In general, a larger base admits a shorter representation of some given number than a smaller base. More precisely, with N(b,k) as the number of base-b digits needed to represent an integer k, if m > n, then N(m,k) ≤ N(n,k) for integers n, m, k; n, m > 1.
@Sollace2 жыл бұрын
0xBEEF is underappreciated, ngl
@thomascotton28342 жыл бұрын
Never heard of this hexit thing, 5A is one hexidecimal byte, 5A 4C is two hexidecimal bytes also known as a short or a word, the byte has two hexidecimal symbols (0 to F) a byte is 8 bit, a nibble is 4 bit, a short or a word is 2 bytes, also known as 16 bits... Never heard or seen the use of the word hexit, which is just one byte represented in hexidecimal, its not a hexit, its one byte which is 8 bit, 00 to ff.. people just call these bytes usually, not hexits. hexit just sounds like some odd conversion tool, id rather just call one byte.. one byte. if theres a community of people using the word hexit instead of byte, i mean no offense, but to me it just looks like one byte of data represented in hexidecimal, people usually just call this a byte, or bytes. "Heres 4 bytes in hexidecimal 5A C3 7B D4"
@Tyrope4 жыл бұрын
5:12 "imagine if we were to write this in decimal", you mean.. like this? rgb(255, 170, 84)?
@homelessrobot3 жыл бұрын
thats representing the components as decimal, not the entire computed value. the entire computed value is 255*(2^16) + (170*(2^8)) + 84, or 16755284. You are not just going to be able to eyeball the components out of a number like that. You /could/ displace the components with a power of 10, but now you've made actually computing the color 10 times more difficult for your computer, and also you are wasting a bunch of padding bits This stuff is mostly important at a lower level than even 99% of programmers regularly operate at anymore, like where things like colors and text and data structures are actually just machine numbers with a thin venere of representative symbols.
@eidiazcas4 жыл бұрын
But what does the 0x mean?
@RubiksSolver254 жыл бұрын
eidiazcas it’s a prefix that indicates the number is in hexadecimal form
@JacobSorber4 жыл бұрын
Yeah, what RubiksSolver25 said (thanks). Otherwise, when you see a number like 101, you wouldn't know if it's decimal or hex.
@eidiazcas4 жыл бұрын
Thanks
@homelessrobot3 жыл бұрын
the leading zero tells the lexer that its a number, as opposed to an identifier with a cool name like FAAB, and the x tells it to interpret it in hex, because numbers like 465 can represent hex, or octal or decimal, but mean different things in each.
@rustycherkas82292 жыл бұрын
@@JacobSorber 101??? Could be binary, octal, decimal or hex! 😂
@leonardesser58024 жыл бұрын
Thank you, J :-)
@JacobSorber4 жыл бұрын
Welcome!
@oluwatobioyinlola4 жыл бұрын
const unit32_t = 0x47F12000; Amazing Prof! :)
@TarousDT2 жыл бұрын
I only see binary in code when there are bit flags, but honestly I don't see hex very often. TO BE FAIR, I don't look at a lot of other people's code, so mostly I just don't use hex xD
@PkMath-e1v3 жыл бұрын
I love hex
@MaheshKumar-lq1xm4 жыл бұрын
Can you please upload your consciousness ? I can download it for my project... Your C videos are my only hope. I have double masters in computer science but still I learn something in every video of yours...👍
@NimaqAlizadeh4 ай бұрын
Nice 🎉
@carbon35492 жыл бұрын
To be honest, I prefer binary representation over hexadecimal representation
@andydelle45094 жыл бұрын
What did you miss? I'll tell you - The dreaded DEC OCTAL base 8 system!
@JacobSorber4 жыл бұрын
I'll let you make that one, ok? 😀
@dara_1989 Жыл бұрын
writing hexa numbers is easy ... but reading them is difficult , impossible
@subsidizer2922 жыл бұрын
Here's an old hexadecimal-based geek joke. Q: "To be or not to be?" A: "FF" 😁
@rustycherkas82292 жыл бұрын
printf( "The answer is %d ", ( 'T' + 'o' + 'B' + 'e' ) & 0x1F );🤣
@janjoska25493 жыл бұрын
bakcground-color: rgb(255,0,0)
@jacko314 Жыл бұрын
missed: negative numbers in hex.
@HaouDeSoul4 жыл бұрын
0xDEAD
@ishaktobbi48606 ай бұрын
i am not saying that the video is bad , but the amount of information compared to the time consumed is not much
@coshvjicujmlqef60474 жыл бұрын
Stop representing other people. I am a programmer and I do not use hexadecimal. And I would argue hex is generally just a horrible disaster. Hex floating-point formatting algorithm is a fucking disaster. Formatting them or parsing them is not as fast as formatting decimal digits.
@justshinigami93642 жыл бұрын
Exceptions make the rule. nobody says hexadecimals have to be used everywhere. but there are many cases where it actually is easier to use hex instead of dec. sometimes its just preference. like bitfields saved as integer: i write them out in binary so i always can look up the bits that are set by me;
@skybyte4me2 жыл бұрын
0:20 I use universal translator btw 🤣
@islandcave87383 жыл бұрын
0x45
@jamesbeatty-wilson5290 Жыл бұрын
Because tostadas were obsolete
@Mintymenty Жыл бұрын
So basically im a programmer now?
@antutucat82314 жыл бұрын
8 bits=1 byte 4 bits=1 hexa 1 byte= 2 hexa
@syamimnijam45864 жыл бұрын
Nibble is a funnier word
@homelessrobot3 жыл бұрын
this is also mixing metaphors; hexa is a description of the visual representation, not the size of the number being represented.
@kraftwerk9744 жыл бұрын
Let me summarise: $FFFFFF is more convenient than %111111111111111111111111 in your code. Isn't it ?
@JohnMarkIsaacMadison4 жыл бұрын
Sometimes binary literals are a bit easier to read than hex for bit flags.
@JacobSorber4 жыл бұрын
Hex is more compact. Readability and convenience depend on what you're doing. But, yeah, binary literals get big fast.
@kraftwerk9744 жыл бұрын
@@JacobSorber actually in my beloved 6510 I never need going beyond $FF for opcodes and $FFFF for addresses for obvious reasons but it's true that for bit instructions I tend to use binary for clarity. BRK.
@lewiscole51934 жыл бұрын
So is 07777777 (octal) now that you mention it, and it's more "convenient" to use if you're programming on a 36-bit machine.
@ckacquah4 жыл бұрын
0xDEADBEEF
@Supaship60004 жыл бұрын
0xBEEF :D
@somuchinfo48794 жыл бұрын
4:00
@maaahakalgupta43172 жыл бұрын
#
@jamesbeatty-wilson5290 Жыл бұрын
Zoog zomg
@justink72692 жыл бұрын
I dont think this is a good explanation.
@chesshooligan12824 жыл бұрын
This video could have been 2-minutes long, perhaps even 1-minute.
@homelessrobot3 жыл бұрын
Maybe you should make your own 1 minute video on the topic then and save people some time? Or maybe don't look a gift horse in the mouth.