Become a better software engineer by learning about different number bases (2024)

A brief introduction to Number Bases in software engineering and computer science

Almost every Computer Science student goes through Number bases at some point in their careers. However, the focus is generally on the how (how to switch between number systems, doing arithmetic with different bases etc). There are tons of great resources to learn the same (I like this guy on YouTube). Instead of reinventing the wheel, I want to touch upon where each number system might be useful to a software engineer or computer scientist.

If this sounds interesting to you, let’s get right into it.

Join 150K+ tech leaders and get insights on the most important ideas in AI straight to your inbox through my free newsletter- AI Made Simple

Binary, The Building Blocks of the Digital Universe: Ultimately, everything starts with binary, the bedrock of computing. Every transistor, every bit of data, every instruction within a computer boils down to the simplicity of 0s and 1s. Let’s touch on the important uses of binary numbers in programming.

Become a better software engineer by learning about different number bases (2)

Notably, understanding binary becomes imperative for tasks like optimizing assembly code, writing device drivers, and interfacing directly with hardware. “On simple low-cost processors, typically, bitwise operations are substantially faster than division, several times faster than multiplication, and sometimes significantly faster than addition.” Aside from Bitwise Ops, Binary is the basis of storage protocols like ASCII and has some interesting applications in compression. Finally, we also have error correction, which also leverages binary numbers. Studying all of these can be very helpful to take your software to the next level.

Become a better software engineer by learning about different number bases (3)

Octal, Bridging the Gap Between Human and Machine:

Binary can get really long and unreadable. Grouping binary digits into sets of three, octal (base-8) offers a more concise and human-readable representation of binary data. Octals also show up for file permissions and network protocols in the UNIX system. As computing has shifted to 16/32/64 bit words, Octals became less useful. Except for some niche cases, you don’t need really need to go out of your way to study them (this is a pretty fun list of some ways Octal numbers have been used though). But you might occasionally run into problems when building something on a system b/c that system uses Octal. So it was worth mentioning it here.

I’m writing a JIT compiler for x86_64, and three-bit octal literals are a godsend. I can construct otherwise complicated ModR/M and SIB values using straightforward math (no bit-shifting) even though they are composed of packed three-bit values.

-Source

My favorite use of 8-bit vectors is their usage in detecting malware. The solution hinges on the fact that image classification is a relatively solved problem, so we turn the malware binary to an 8-bit vector, which is then turned into a grayscale image. We can train classifiers on these images (+ analyze them ourselves), which improves our performance significantly. This is something you can extend to various challenges (I have done this with great results), but it requires some setup.

Become a better software engineer by learning about different number bases (4)

Hexadecimal, for Memory and Color Palettes: Next, we encounter the hexadecimal base, which is clutch for memory management and color representation. “Memory is often manipulated in terms of larger units, such as pages or segments, which tend to have sizes that are powers of 2. So if addresses are expressed in hex, it’s much easier to read them as page+offset or similar constructs. Decimal is difficult because of that pesky factor of 5, and binary addresses are too long to be easily readable.This is also similar to why we use Hexadecimal to represent colors

P-adic Numbers, The Untamed Wildcards of the Counting Game: P-adic arithmetic is a method of representing and performing arithmetic on real numbers using a different number system based on the prime number p. In software engineering, p-adic arithmetic allows for error-free representation of fractions and error-free arithmetic using fractions, which can be advantageous in certain computational tasks. There are two main types of p-adic arithmetic: “infinite-precision p-adic arithmetic which is more suitable for software implementations and finite-precision p-adic arithmetic which is more suitable for hardware implementations. The finite-precision p-adic representation is also called Hensel code which has certain interesting properties and some open problems for research.”

If you’re looking to bring some beauty to you life, p-adics will help a ton there too-

Become a better software engineer by learning about different number bases (5)

P-adic numbers are pretty good for fractals, which aside from having various applications, just look really cool. I remember spending a few hours experimenting with fractals and playing with different representations when I first learned about them (that was my version of stable diffusion/AI art generators). It seems like p-adic numbers might have some potential in embeddings, but there is a lot of math I have to learn before I can make any conclusions .

Become a better software engineer by learning about different number bases (6)

If you are looking for skills to add into your toolbelt as a software developer, understanding the various number bases and the role they play is key. More than the implementation details, it can be beneficial to read into each use case in a lot of detail to build up your pattern recognition skills.

If you liked this article and wish to share it, please refer to the following guidelines.

Save the time, energy, and money you would burn by going through all those videos, courses, products, and ‘coaches’ and easily find all your needs met in one place at ‘Tech Made Simple’! Stay ahead of the curve in AI, software engineering, and the tech industry with expert insights, tips, and resources. 20% off for new subscribers by clicking this link. Subscribe now and simplify your tech journey!

Using this discount will drop the prices-

800 INR (10 USD) → 640 INR (8 USD) per Month

8000 INR (100 USD) → 6400INR (80 USD) per year (533 INR /month)

Get 20% off for 1 year

Become a better software engineer by learning about different number bases (7)

Use the links below to check out my other content, learn more about tutoring, reach out to me about projects, or just to say hi.

Small Snippets about Tech, AI and Machine Learning over here

AI Newsletter- https://artificialintelligencemadesimple.substack.com/

My grandma’s favorite Tech Newsletter- https://codinginterviewsmadesimple.substack.com/

Check out my other articles on Medium. : https://rb.gy/zn1aiu

My YouTube: https://rb.gy/88iwdd

Reach out to me on LinkedIn. Let’s connect: https://rb.gy/m5ok2y

My Instagram: https://rb.gy/gmvuy9

My Twitter: https://twitter.com/Machine01776819

Become a better software engineer by learning about different number bases (2024)
Top Articles
9 Key Signs That ‘Bank Representative’ Is Actually a Scammer
The Amex Blue Cash Preferred is worth it if you buy groceries
Po Box 7250 Sioux Falls Sd
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Avonlea Havanese
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
Best Theia Builds (Talent | Skill Order | Pairing + Pets) In Call of Dragons - AllClash
Barstool Sports Gif
Acbl Homeport
Azeroth Pilot Reloaded - Addons - World of Warcraft
Bros Movie Wiki
Springfield Mo Craiglist
Love In The Air Ep 9 Eng Sub Dailymotion
Midlife Crisis F95Zone
Craftology East Peoria Il
Eva Mastromatteo Erie Pa
Mzinchaleft
Palm Coast Permits Online
NHS England » Winter and H2 priorities
Bj Alex Mangabuddy
Unity - Manual: Scene view navigation
Governor Brown Signs Legislation Supporting California Legislative Women's Caucus Priorities
Hampton University Ministers Conference Registration
Jordan Poyer Wiki
How to Make Ghee - How We Flourish
Walmart Pharmacy Near Me Open
Beaufort 72 Hour
Kroger Feed Login
4Oxfun
JVID Rina sauce set1
Marokko houdt honderden mensen tegen die illegaal grens met Spaanse stad Ceuta wilden oversteken
Ou Football Brainiacs
Miles City Montana Craigslist
Angel Haynes Dropbox
Publix Christmas Dinner 2022
Craftsman Yt3000 Oil Capacity
Motor Mounts
Kamzz Llc
4083519708
Second Chance Apartments, 2nd Chance Apartments Locators for Bad Credit
Pain Out Maxx Kratom
6576771660
Here's Everything You Need to Know About Baby Ariel
Lady Nagant Funko Pop
Port Huron Newspaper
Crigslist Tucson
Devotion Showtimes Near Showplace Icon At Valley Fair
552 Bus Schedule To Atlantic City
Diccionario De Los Sueños Misabueso
Sam's Club Fountain Valley Gas Prices
Latest Posts
Article information

Author: Lilliana Bartoletti

Last Updated:

Views: 6621

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Lilliana Bartoletti

Birthday: 1999-11-18

Address: 58866 Tricia Spurs, North Melvinberg, HI 91346-3774

Phone: +50616620367928

Job: Real-Estate Liaison

Hobby: Graffiti, Astronomy, Handball, Magic, Origami, Fashion, Foreign language learning

Introduction: My name is Lilliana Bartoletti, I am a adventurous, pleasant, shiny, beautiful, handsome, zealous, tasty person who loves writing and wants to share my knowledge and understanding with you.