Converter Tool

0 characters

Enter an octal number (0-7). The '0o' prefix is optional. Choose between unsigned and signed (two's complement) interpretation.

Bits:

0

Type:

Unsigned

Binær repræsentation:

Hexadecimal repræsentation:

Om talsystemer

Oktalt system

The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Octal numerals can be made from binary numerals by grouping consecutive binary digits into groups of three (starting from the right).

Decimal Konverteringstabel

Octal Decimal Octal Decimal
0 0 4 4
1 1 5 5
2 2 6 6
3 3 7 7

Decimal System

Decimalsystemet er et base-10 nummereringssystem, der bruger ti forskellige symboler: 0, 1, 2, 3, 4, 5, 6, 7, 8 og 9. Det er det mest almindeligt anvendte talsystem i hverdagen.

Two's Komplement

Two's komplement er en matematisk operation, der bruges til at repræsentere negative tal i binære systemer. Det er meget udbredt i computere, fordi det forenkler aritmetiske operationer såsom addition og subtraktion.

For at konvertere et positivt tal til dets negative modstykke i tos komplement:

  1. Konverter tallet til binært.
  2. Invert all the bits (change 0 to 1 and 1 to 0).
  3. Tilføj 1 til resultatet af inversionen.

For at konvertere en negativ to's komplementtal tilbage til decimal:

  1. Inverter alle bits.
  2. Tilføj 1 til resultatet af inversionen.
  3. Konverter resultatet til decimal og sæt et negativt fortegn foran det.

Eksempel: 8-bit two's komplementområde

Positive Number (5):

0000 0101 (binary)

Negative Number (-5):

1111 1010 (inverted bits of 5)

1111 1011 (add 1 = two's complement representation of -5)

for 8-bit two's komplement:

-128 (1000 0000) to 127 (0111 1111)

Related Tools