Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Hexadecimal
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Binary conversion=== [[File:Hewlett-Packard Model HP-16C Programmable RPN Calculator, HP's First and Only Calculator esp. for Programmers, built 1982-1989 (edited to rectangular, V2).jpg|thumb|The programmable [[Reverse Polish notation|RPN]]-calculator [[HP-16C|HP-16C Computer Scientist]] from 1982 was designed for programmers. One of its key features was the conversion between different numeral systems (note hex number in display).]] Most computers manipulate binary data, but it is difficult for humans to work with a large number of digits for even a relatively small binary number. Although most humans are familiar with the base 10 system, it is much easier to map binary to hexadecimal than to decimal because each hexadecimal digit maps to a whole number of bits (4<sub>10</sub>). This example converts 1111<sub>2</sub> to base ten. Since each [[Positional notation|position]] in a binary numeral can contain either a 1 or a 0, its value may be easily determined by its position from the right: * 0001<sub>2</sub> = 1<sub>10</sub> * 0010<sub>2</sub> = 2<sub>10</sub> * 0100<sub>2</sub> = 4<sub>10</sub> * 1000<sub>2</sub> = 8<sub>10</sub> Therefore: {| |- | 1111<sub>2</sub>|| = 8<sub>10</sub> + 4<sub>10</sub> + 2<sub>10</sub> + 1<sub>10</sub> |- | || = 15<sub>10</sub> |} With little practice, mapping 1111<sub>2</sub> to F<sub>16</sub> in one step becomes easy (see table in [[#Written representation|written representation]]). The advantage of using hexadecimal rather than decimal increases rapidly with the size of the number. When the number becomes large, conversion to decimal is very tedious. However, when mapping to hexadecimal, it is trivial to regard the binary string as 4-digit groups and map each to a single hexadecimal digit.<ref name=Mano-Ciletti/> This example shows the conversion of a binary number to decimal, mapping each digit to the decimal value, and adding the results. {| | (1001011100)<sub>2</sub>|| = 512<sub>10</sub> + 64<sub>10</sub> + 16<sub>10</sub> + 8<sub>10</sub> + 4<sub>10</sub> |- | || = 604<sub>10</sub> |} Compare this to the conversion to hexadecimal, where each group of four digits can be considered independently and converted directly: {| |- | (1001011100)<sub>2</sub>|| = ||0010<sub> </sub>||0101<sub> </sub>||1100<sub>2</sub> |- | || = || align="center" |2|| align="center" |5||align="center" |C<sub>16</sub> |- | || = || colspan="5" |25C<sub>16</sub> |} The conversion from hexadecimal to binary is equally direct.<ref name=Mano-Ciletti>{{cite book|title=Digital Design β With an Introduction to the Verilog HDL|edition=Fifth|last1=Mano|first1=M. Morris|last2=Ciletti|first2=Michael D.|publisher=[[Pearson Education]]|date=2013|pages=6, 8β10|isbn=978-0-13-277420-8}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Hexadecimal
(section)
Add topic