Express the decimal number ##43## as a binary number

  • #1
chwala
Gold Member
2,756
390
Homework Statement
Express the number ##43## as a binary scale
Relevant Equations
##P=a_02^n + a_12^{n-1} + ...##
I have ##43=1⋅2^5 + 0⋅2^4+1⋅2^3 + 0⋅2^2 + 1⋅2+1##
Therefore, ##43= 101011##

any insight welcome...new area to me.
 
Physics news on Phys.org
  • #2
This seems ok. Did you have a concrete question?
 
  • Like
Likes chwala
  • #3
chwala said:
Homework Statement: Express the number ##43## as a binary scale
Relevant Equations: ##P=a_02^n + a_12^{n-1} + ...##

I have ##43=1⋅2^5 + 0⋅2^4+1⋅2^3 + 0⋅2^2 + 1⋅2+1##
Therefore, ##43= 101011##

any insight welcome...new area to me.
You can WA check this for you:
https://www.wolframalpha.com/input?i=43
and if you want to know the results to other bases
https://www.wolframalpha.com/input?i=43_3
 
  • Like
Likes MatinSAR and chwala
  • #4
chwala said:
Homework Statement: Express the number ##43## as a binary scale
Relevant Equations: ##P=a_02^n + a_12^{n-1} + ...##

I have ##43=1⋅2^5 + 0⋅2^4+1⋅2^3 + 0⋅2^2 + 1⋅2+1##
Therefore, ##43= 101011##

any insight welcome...new area to me.
I'm not sure what is meant by "binary scale" but decimal 43 is ##101011_2## (i.e., in base-2). Your work above constitutes a check, as 32 + 8 + 2 + 1 equals 43, verifying your result.

One algorithm for converting from decimal numbers to binary numbers is as follows:
Divide the decimal number by 2, and write down the remainder (either 0 or 1). Divide the quotient by 2, and continue down the remainder. Keep dividing until the quotient equals 0, and write the remainders in reverse order to find the binary number. From https://www.wikihow.com/Convert-from-Decimal-to-Binary

BTW, two bases are very significant in relation to computers: binary (base-2) and hexadecimal (base-16), a system with 16 digits 0, 1, 2, ..., 9, A, B, C, D, E, F. It's very easy to convert from binary to hexadecimal. This can be done by collecting the binary digits into groups of four digits, starting from the right, the least significant digit. For example, 101011 can be written in two groups -- 0010 1011. The left-most digit in hex is 2 and the right-most is B (decimal 11), producing the hexadecimal number 2B, which is often written as 0x2B with the 0x prefix signifying that this is a hexadecimal number. 0x2B means ##2 \times 16^1 + 11 \times 16^0## or 32 + 11 = 43 in base-10.
 
Last edited:
  • Informative
Likes chwala
  • #5
I usually do it as:

##43 \geq 32 = 2^5## therefore ##43 = 32 + (43-32) = 32 + 11##
##11 \geq 8 = 2^3## therefore ##43 = 32 + 11 = 32 + 8 + (11-8) = 32+8+3##
##3 \geq 2 = 2^1## therefore ##43 = 32+8+2+(3-2) = 32+8+2+1 = 2^5 + 2^3 + 2^1 + 2^0 = 101011_2##
 
  • Informative
  • Like
Likes MatinSAR, chwala and WWGD
  • #6
It's technically a sequence of Real numbers above, with ##43## or the target number ##T ##as an upper bound. We can show ##T## is the lub( Least Upper Bound), and the sequence of approximations converges to ##T##.
 
  • #8
Mark44 said:
I'm not sure what is meant by "binary scale" but decimal 43 is ##101011_2## (i.e., in base-2). Your work above constitutes a check, as 32 + 8 + 2 + 1 equals 43, verifying your result.

One algorithm for converting from decimal numbers to binary numbers is as follows:
Divide the decimal number by 2, and write down the remainder (either 0 or 1). Divide the quotient by 2, and continue down the remainder. Keep dividing until the quotient equals 0, and write the remainders in reverse order to find the binary number. From https://www.wikihow.com/Convert-from-Decimal-to-Binary

BTW, two bases are very significant in relation to computers: binary (base-2) and hexadecimal (base-16), a system with 16 digits 0, 1, 2, ..., 9, A, B, C, D, E, F. It's very easy to convert from binary to hexadecimal. This can be done by collecting the binary digits into groups of four digits, starting from the right, the least significant digit. For example, 101011 can be written in two groups -- 0010 1011. The left-most digit in hex is 2 and the right-most is B (decimal 11), producing the hexadecimal number 2B, which is often written as 0x2B with the 0x prefix signifying that this is a hexadecimal number. 0x2B means ##2 \times 16^1 + 11 \times 16^0## or 32 + 11 = 43 in base-10.
interesting but i get the flow;
##43= 2B##
##53=35## with the hexagonal system running from ##{0 1 2 3 ... 9 A B C D E F}##. Any particular purpose for this systems...i understand binary digits are computer related. What about hexagonal? How many number systems in this context are there?
Cheer and happy new year 2025!
 
  • Like
Likes WWGD and fresh_42
  • #9
chwala said:
interesting but i get the flow;
##43= 2B##
##53=35## with the hexagonal system running from ##{0 1 2 3 ... 9 A B C D E F}##. Any particular purpose for this systems...i understand binary digits are computer related. What about hexagonal? How many number systems in this context are there?
Cheer and happy new year 2025!
Hex is used far more often in high level programming because it's simply easier to read and talk about then long binary strings, since it's base 16 it's also fairly easy to switch between binary and hex. Each hex digit represents a string of 4 binary digits.

Try it yourself, convert 2B to binary by serperating each hex digit into a string of 4 binary digits.
 
Last edited:
  • Informative
Likes chwala
  • #10
chwala said:
interesting but i get the flow;
##43= 2B##
##53=35## with the hexagonal system running from ##{0 1 2 3 ... 9 A B C D E F}##. Any particular purpose for this systems...i understand binary digits are computer related. What about hexagonal? How many number systems in this context are there?
Cheer and happy new year 2025!
You should note the base in these cases because the ciphers on the two sides of the equation mean something different. You could write for instance
##43=X2B## or ##43_{10}=2B_{16}## and ##53=X35## or ##53_{10}=2B_{16}.##

Computers use bits with values ##0## and ##1##, yes, but bits are grouped into bytes (##8## bits) and words (##16, 32## or ##64## bits), which are easier to handle with octal or hexadecimal number systems.
 
  • Informative
  • Like
Likes QuarkyMeson and chwala
  • #11
To add on Fresh's comment, in the context of programming you'll often see binary and hex literals with a prefix, such as 0x for hex literals or 0b for binary literals. In the example of the hex number 2B you might see 0x2B, perhaps in the context of a register for a device.

If I want to tell a coworker the register he needs to use is 0x2B, this is far easier than saying please use register 0b00101011.
 
  • Like
Likes chwala, WWGD and fresh_42
  • #12
chwala said:
interesting but i get the flow;
##43= 2B##
##53=35## with the hexagonal system running from ##{0 1 2 3 ... 9 A B C D E F}##.
That's hexadecimal, not hexagonal. Hexagonal has to do with geometry and describes an object with 6 sides. Hexadecimal combines "six" and "ten" to suggest 16.
chwala said:
Any particular purpose for this systems...i understand binary digits are computer related. What about hexagonal? How many number systems in this context are there?
Another number base that was used a lot in the past is octal, or base-8, which has digits, 0, 1, 2, ..., 7. You can easily convert a number in binary form to octal or hexadecimal by dividing the binary digits into groups of 3 (for octal) or groups of 4 (for hexadecimal).
Besides binary, octal, and hexadecimal, web browsers use a base-64 system whose digits include A through Z, a through z, 0 through 9, and two other non-alphabetic, non-numeric characters. Text and images etc. can be sent "over the wire" by being encoded into base-64 digits, and then decoded at the destination browser.
 
  • Informative
  • Like
Likes Gavran and chwala
  • #13
You can use the general form of a whole number in a base b system $$ (a_na_{n-1}...a_1a_0)_b=\sum_{k=0}^{n}a_kb^k $$ for converting a whole number from a numeral system to another numeral system.
\begin{align}
(43)_{10}&=(4\cdot10^1+3\cdot10^0)_{10}\nonumber\\
&=(100\cdot1010^1+11\cdot1010^0)_2\nonumber\\
&=(100\cdot1010+11\cdot1)_2\nonumber\\
&=(101000+11)_2\nonumber\\
&=(101011)_2\nonumber
\end{align}
 
  • Like
  • Informative
Likes WWGD and chwala
  • #14
chwala said:
interesting but i get the flow;
##43= 2B##
##53=35## with the hexagonal system running from ##{0 1 2 3 ... 9 A B C D E F}##. Any particular purpose for this systems...
Why hexadecimal?

Hexadecimal is used as a compact and human-readable way to encode binary data. Four binary digits per hexadecimal character. We want to be able to express binary data because computers work with binary data.

Modern computers use word sizes that are multiples of four bits. 32 bit words and 64 bit words are common. 16 bit words were used historically and eight bit bytes have become completely standard. This means that we can express the contents of a computer word as a string of hexadecimal characters with no bits left over. For this reason, hexadecimal is the overwhelmingly popular modern standard.

In the old days, architectures with 12 bit words (PDP-8) or 36 bit words (PDP-10) or even 60 bit words (CDC Cyber) were used. For these word sizes, a base 8 (octal) representation was adopted since that fit well with the word size and did not involve non-numeric digits. Those platforms are ancient. One tends not to see much octal these days.

As has been mentioned, base 64 is also used when one wants to convert binary to text that can survive character set translation (e.g. ASCII to EBCDIC). It is not very human readable, so only subject matter experts tend to see it much.

It comes down to a trade off between compactness and readability.

Binary is one bit per character. It would take 32 characters to express a 32 bit word.
Octal is three bits per character. It takes 11 characters to express a 32 bit word.
Hex is four bits per character. It takes 8 characters to express a 32 bit word.
Base 64 is six bits per character. It takes 6 characters to express a 32 bit word.

Binary suffers in readability due to the long length.

Octal has no alphabetic digits to fret over. But you have bits left over if you express a 32 bit word.

Hex has alphabetic digits to fret over. But it lines up evenly on a 32 bit word boundary and is more compact than octal.

Base 64 is hard for humans to process. And does not line up with a 32 bit word boundary. But it is as compact as one can reasonably get for ordinary text.
 
Last edited:
  • Informative
Likes chwala

Similar threads

Replies
11
Views
1K
Replies
14
Views
1K
Replies
1
Views
2K
Replies
5
Views
1K
Replies
1
Views
1K
Back
Top