Why do programmers use hexadecimal numbers?

preview_player
Показать описание
---

Ever wondered about hex. Hexadecimal numbers can be intimidating to people just learning to program. This video explains what they are, how they work, and when to use them, as a more convenient replacement for binary numbers, when representing memory and network addresses, and when using bitmasks, RGB colors, and anytime when the binary representation matters.



***

Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.

About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.

More about me and what I do:

To Support the Channel:
+ like, subscribe, spread the word

Рекомендации по теме
Комментарии
Автор

Your channel has very rich content. The quality of the videos, your presentation skill is really nice.

mshingote
Автор

What a clear and very useful explanation of when and why to use Hex! Thanks.

cellmaker
Автор

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

wojciechjaworski
Автор

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.

KaspianBerheimBrudin-nyge
Автор

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.

jimnoeth
Автор

Taking David Bombal's CCNA course and this just helped me greatly. Much simpler explanation and now converting to binary is easy, thanks !

meme-dhg
Автор

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.

derekkonigsberg
Автор

I'm digging the goatee look! Great video, as usual, thanks for putting it together!

MickZeller
Автор

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.

Jenny_Digital
Автор

Great timing for this video. I just start programming with hexadecimal numbers at my job.

thomasmurphy
Автор

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 to set all pins to input.
Enjoying your videos.

johnjackson
Автор

Fantastic summary! Hexadecimal numbers here I come, thanks for the heads up Jason!!

Maha_s
Автор

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!

Jenny_Digital
Автор

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!

ColinBroderickMaths
Автор

@07:15 "Favourite uses for hex?"
Sending messages to NASA if/when I'm ever marooned on Mars... 👽
🤣🤣🤣🤣🤣

rustycherkas
Автор

Great video as always! Thanks for sharing your knowledge with us. :)

odpisani
Автор

How about Stackimal (base 64) or hexadecahexadecimal (base 256)?

MinhAIPet
Автор

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.

Rakusan
Автор

Before the 80s Octal was quite popular too and going back even further BCD.

mnoxman
Автор

Very useful video, I wish I had come across this sooner.

anandjoshua