Explore, analyze, and understand digital concepts visually.
Learn digital systems, Boolean logic, numbering systems, and codes through interactive visual tools.
1. Base Converter
Convert integers between bases and follow the process step by step.
Results
☷ Step-by-step explanation
Convert integers between bases and follow the process step by step.
2. Positional Value
Understand how each digit changes value depending on its position and the base.
Positional expansion
Enter a valid number and select Analyze to visualize its positions.
3. Arithmetic
Perform operations in different number systems and follow every step.
Result
Your result will appear here
Enter both numbers and select Calculate.
Result in other bases
Binary
Base 2Octal
Base 8Decimal
Base 10Hexadecimal
Base 16Enter both numbers and select Calculate.
Changing the base changes how a number is written, but not the quantity it represents. Each position has weight bⁱ, where b is the base and i starts at zero on the right.
- Addition: when the sum reaches the base, write its remainder modulo the base and carry one to the next column. In binary, 1 + 1 = 10.
- Subtraction: when a column has too little value, borrow one unit from the next position. That unit is worth b units in the current column.
- Multiplication: shifting one position to the left multiplies the product by the base; add the partial products to get the total.
- Integer division: dividend = divisor × quotient + remainder. The remainder is non-negative and always smaller than the divisor.
Exact integer arithmetic with no fixed word size or overflow. A minus sign indicates a negative result; it is not a two’s complement representation.
Example: 11 + 13 = 24 in decimal. Your calculations will appear here after calculating.
| Base | Operation |
|---|---|
| Binary (2) | + = |
| Octal (8) | + = |
| Decimal (10) | + = |
| Hexadecimal (16) | + = |
◆ Results
Sign-magnitude
Range: -127 … 127
One’s complement
Range: -127 … 127
Two’s complement
Range: -128 … 127
Unsigned interpretation
Range: 0 … 255
Enter a value to explore its representation.
Enter a value to explore its representation.
The most significant bit (MSB) is the leftmost bit. In a signed representation it determines how the word is interpreted.
Sign-magnitude uses one sign bit and N−1 magnitude bits. One’s complement inverts the positive word to encode a negative value.
Two’s complement inverts the bits and adds one. Its arithmetic works modulo 2ᴺ, allowing the same addition hardware for positive and negative integers.
Sign-magnitude and one’s complement have +0 and −0. Two’s complement has a single zero.
The minimum two’s-complement value has no counterpart in the other two signed representations. Those cards show “Not representable”.
5. Codes
Explore codes that represent numbers, characters and information in digital systems.
What are codes?
Codes define how bit patterns represent information. The same sequence can denote a number, a character, a position or a word protected by check bits.
Choose a tool below. Each keeps its own inputs and results during navigation.
Gray Code
Convert in either direction and compare consecutive values.
BCD
Encode each decimal digit separately using a four-bit group.
ASCII
Explore standard 7-bit ASCII, with values from 0 to 127.
Parity
Generate a parity bit or check a received word.
Hamming Code
Encode four data bits or decode seven bits with single-error correction.
Binary ↔ Gray Code
Convert in either direction and compare consecutive values.
Enter a value to explore its representation.
Binary vs Gray Code
Reference sequence: 1–6 bits, up to 64 rows. Highlighted Gray bits changed from the previous row. The table width is independent of the converter.
| Decimal | Binary | Gray Code |
|---|---|---|
| 0 | | |
| 1 | | |
| 2 | | |
| 3 | | |
| 4 | | |
| 5 | | |
| 6 | | |
| 7 | | |
Number Line Comparison
| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| Binary | | | | | | | | |
| Gray Code | | | | | | | | |
Keep the first bit. Binary → Gray uses XOR of adjacent binary bits. Gray → Binary uses XOR of the previous decoded bit with the current Gray bit.
◇ Properties · Gray Code
Consecutive reflected Gray values differ in exactly one bit. This reduces ambiguity while a position changes; it does not provide general error detection or correction.
Rotary encoders, position sensors, selected ADC designs and control systems.
Decimal ↔ BCD 8421
Encode each decimal digit separately using a four-bit group.
Enter a value to explore its representation.
Each group uses weights 8, 4, 2 and 1. Groups 1010–1111 do not represent decimal digits. Leading decimal zeroes are preserved.
| Decimal digit | BCD 8421 |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
◇ Properties · BCD
BCD is a decimal digit code, not the pure binary value of the entire number: 59 becomes 0101 1001.
Decimal displays, counters and systems that process decimal digits directly.
Text ↔ ASCII
Explore standard 7-bit ASCII, with values from 0 to 127.
Result
Enter a value to explore its representation.
Each row maps one character to its decimal, hexadecimal and binary values. Control characters use their standard abbreviations; spaces are labeled explicitly.
| Character | Decimal | Hexadecimal | Binary |
|---|---|---|---|
| Space | 32 | 20 | |
| ! | 33 | 21 | |
| " | 34 | 22 | |
| # | 35 | 23 | |
| $ | 36 | 24 | |
| % | 37 | 25 | |
| & | 38 | 26 | |
| ' | 39 | 27 | |
| ( | 40 | 28 | |
| ) | 41 | 29 | |
| * | 42 | 2A | |
| + | 43 | 2B | |
| , | 44 | 2C | |
| - | 45 | 2D | |
| . | 46 | 2E | |
| / | 47 | 2F | |
| 0 | 48 | 30 | |
| 1 | 49 | 31 | |
| 2 | 50 | 32 | |
| 3 | 51 | 33 | |
| 4 | 52 | 34 | |
| 5 | 53 | 35 | |
| 6 | 54 | 36 | |
| 7 | 55 | 37 | |
| 8 | 56 | 38 | |
| 9 | 57 | 39 | |
| : | 58 | 3A | |
| ; | 59 | 3B | |
| < | 60 | 3C | |
| = | 61 | 3D | |
| > | 62 | 3E | |
| ? | 63 | 3F | |
| @ | 64 | 40 | |
| A | 65 | 41 | |
| B | 66 | 42 | |
| C | 67 | 43 | |
| D | 68 | 44 | |
| E | 69 | 45 | |
| F | 70 | 46 | |
| G | 71 | 47 | |
| H | 72 | 48 | |
| I | 73 | 49 | |
| J | 74 | 4A | |
| K | 75 | 4B | |
| L | 76 | 4C | |
| M | 77 | 4D | |
| N | 78 | 4E | |
| O | 79 | 4F | |
| P | 80 | 50 | |
| Q | 81 | 51 | |
| R | 82 | 52 | |
| S | 83 | 53 | |
| T | 84 | 54 | |
| U | 85 | 55 | |
| V | 86 | 56 | |
| W | 87 | 57 | |
| X | 88 | 58 | |
| Y | 89 | 59 | |
| Z | 90 | 5A | |
| [ | 91 | 5B | |
| \ | 92 | 5C | |
| ] | 93 | 5D | |
| ^ | 94 | 5E | |
| _ | 95 | 5F | |
| ` | 96 | 60 | |
| a | 97 | 61 | |
| b | 98 | 62 | |
| c | 99 | 63 | |
| d | 100 | 64 | |
| e | 101 | 65 | |
| f | 102 | 66 | |
| g | 103 | 67 | |
| h | 104 | 68 | |
| i | 105 | 69 | |
| j | 106 | 6A | |
| k | 107 | 6B | |
| l | 108 | 6C | |
| m | 109 | 6D | |
| n | 110 | 6E | |
| o | 111 | 6F | |
| p | 112 | 70 | |
| q | 113 | 71 | |
| r | 114 | 72 | |
| s | 115 | 73 | |
| t | 116 | 74 | |
| u | 117 | 75 | |
| v | 118 | 76 | |
| w | 119 | 77 | |
| x | 120 | 78 | |
| y | 121 | 79 | |
| z | 122 | 7A | |
| { | 123 | 7B | |
| | | 124 | 7C | |
| } | 125 | 7D | |
| ~ | 126 | 7E | |
◇ Properties · ASCII
ASCII is a 7-bit character code. Accented characters, emoji and other Unicode characters require another encoding and are rejected here.
Text interchange, protocols and basic character representation.
Even & Odd Parity
Generate a parity bit or check a received word.
Result
Enter a value to explore its representation.
Even parity makes the total number of ones even; odd parity makes it odd. Count all bits, including the rightmost parity bit, when checking a word.
◇ Properties · Parity
Parity detects any odd number of bit flips, but misses an even number of flips. It cannot locate or correct an error.
Simple transmission and memory checks.
Hamming (7,4)
Encode four data bits or decode seven bits with single-error correction.
P1, P2, P4 · Parity bitD1–D4 · Data
Result
Enter a value to explore its representation.
Correction assumes at most one flipped bit. Multiple errors can produce a misleading syndrome and an incorrect correction.
P1 checks positions 1, 3, 5, 7; P2 checks 2, 3, 6, 7; P4 checks 4, 5, 6, 7. The syndrome is ordered S4 S2 S1; its binary value indicates a position from 1 to 7.
◇ Properties · Hamming Code
Hamming (7,4) corrects one bit under the single-error assumption. It cannot reliably distinguish a two-bit error from a one-bit error. SECDED needs an additional parity bit.
Educational models of protected communication and memory words.