Decimal till Hex

Konvertera decimaltal till hexadecimala utan ansträngning

Verktyg för omvandlare

Enter a decimal number. Choose between unsigned and signed (two's complement) interpretation. Select the bit size to format the output correctly.

Bits:

0

Type:

Unsigned

Binär representation:

Om talsystem

Decimalsystem

Decimalsystemet är ett bas-10-numreringssystem som använder tio distinkta symboler: 0, 1, 2, 3, 4, 5, 6, 7, 8 och 9. Det är det mest använda talsystemet i vardagen.

Hexadecimalt system

The hexadecimal system is a base-16 numbering system that uses 16 distinct symbols. These symbols are 0-9 to represent values zero to nine, and A-F (or a-f) to represent values ten to fifteen.

Decimal till hexadecimal omvandlingstabell

Decimal Hexadecimal Decimal Hexadecimal
0 0 8 8
1 1 9 9
2 2 10 A
3 3 11 B
4 4 12 C
5 5 13 D
6 6 14 E
7 7 15 F

Tvås komplement

Tvåkomplement är en matematisk operation som används för att representera negativa tal i binära system. Det används ofta inom databehandling eftersom det förenklar aritmetiska operationer som addition och subtraktion.

Så här konverterar du ett positivt tal till dess negativa motsvarighet i två komplement:

  1. Konvertera talet till binärt.
  2. Invert all the bits (change 0 to 1 and 1 to 0).
  3. Lägg till 1 till resultatet av inversionen.

Så här konverterar du ett negativt tvåkomplementtal tillbaka till decimaltal:

  1. Invertera alla bitar.
  2. Lägg till 1 till resultatet av inversionen.
  3. Konvertera resultatet till decimal och prefixa det med ett negativt tecken.

Exempel: 8-bitars Two's Supplement

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)

Omfång för 8-bitars Two's Supplement:

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

Related Tools