r/QuickBasic • • Feb 14 '26

Your guide on which radix (BASE-n) counting system is ideal for QBasic programming

There's a variety of BASE-n counting systems, such as OCTAL (BASE-8), DECIMAL (BASE-10), and HEXADECIMAL (BASE-16), the BIG THREE of the counting systems that are used in programming, but then there's also a more technical one which is for savvy programmers, BINARY (BASE-2), where 0s and 1s are used for "bits" (binary digits). Bits are useful for boolean logic with true/false, and stuff like that, now, let's make a chart of a variety of counting systems.

n-base (radix)(un)official namehow mainstream?purposeadditional notes
2binarymainstream for machine code, and low-level programmingfor true/false statements, low-level programming, and sometimes, data compression, etc.uses 0s and 1s as it's only digits, so a number as low as 10 in BASE-10, will look like 1010 in BASE-2, which would be "one thousand and ten" in BASE-10.
8octalmainstream for simplified counting with fewer superficial digits than binary
10decimalthe most commonly used counting system for the end-user and average joes.Those who use it can range anywhere from normal individuals who need simple counting, to advanced experts such as mathematicians who understand traditional mathematics.when represented, the DATA TYPES use wizardry under the hood to convert the format for recognition.
16hexadecimalmainstream for tech-savvy onesoften used for tapping into memory addresses, and setting values for them, when debugging, and etc.it uses letters A to F as single characters for the decinal equivalents from 10 to 15, and appears as "10" in the decimal equivalent of 16, yup, SWEET 10!
27alphabet + spacebarmore mainstream as a word writing system than a counting systemwriting messages and letters to people, and used as human-readable words for text strings in programming.the alphabet has 26 letters, and a space between words counts as unofficially, either a 0th, or 27th (by some) letter of the alphabet.
36alphanumericmainstream for databasesa way to use fewer digits for database identity without looking too "jibberish"other symbols of the 220 other ASCII characters would make it confusing to index things, which is why numeric digits 0-9 and alphabetical letters A-Z are used.
256bytevery mainstreamused as a common metric for measuring filesizes, and useful for ASCII strings outside of counting "numbers", and etc.BASE-256 is often used for identity and encoding messages, rather than merely counting numbers.

This is an abridged list of counting systems (radices).

When inputting numbers, we use &o to input octal numbers, and &h for hexadecimal when using QBasic.

examples:

&o77 = 63

&h45 = 69

just thought I'd give a summary about counting systems for programming.

Now, let's explain some examples of reasons to apply certain counting systems on QBasic.

BASE/radixname for BASE-n systemexample of a purpose it's useful forcode example:
2binarybitwise operations (boolean data)a = 1
8octaluseful for assigning values for SCREEN 0 colors. IC for default palette/attributes (intensity, then color), and dB for the 64 color palette (dark, the BRIGHT)PALETTE IC, dB
10decimalfor the end user to set numeric valuesPRINT 10 + 12
16hexadecimaluseful for memory addressingDEF SEG = &hB800

just thought I'd share something informative.

1 Upvotes

0 comments sorted by