How do you convert a number between decimal and binary?

The number system we use to write numbers is called a positional system. Each digit of the number is a multiplier of the increasing powers of the base. So for binary:
10112 = 1 * 23 + 0 * 22 + 1 * 21 + 1 * 20 To convert the number 10112 to decimal, we simply need to add and multiply:= 8 + 0 + 2 + 1 = 1110 (we usually don't write the base in decimal number, this is just for illustrative purposes.
To convert a decimal number into binary, we use a different method. We take on any decimal number, e.g. 294, and continuously divide it by 2 with a reminder, like so:
294 : 2 = 147 | remainder: 0 - least significant bit (last digit)147 : 2 = 73 | remainder: 173 : 2 = 36 | remainder: 136 : 2 = 18 | remainder: 018 : 2 = 9 | remainder: 09 : 2 = 4 | remainder: 14 : 2 = 2 | remainder: 02 : 2 = 1 | remainder: 01 : 2 = 0 | remainder: 1 - most significant bit (first digit)0
So the decimal number 294 converts to: 1001001102And this holds for all numbers.

Answered by Kacper M. Computing tutor

955 Views

See similar Computing IB tutors

Related Computing IB answers

All answers ▸

Explain the difference between the cache memory and the buffer.


Question 14)http://ibdocuments.com/IB%20PAST%20PAPERS%20-%20SUBJECT/Group%204%20-%20The%20sciences/Computer_science_SL/2007%20November%20Examination%20Session/English%20Papers/Computer_science_paper_1_SL.pdf


Name the memories in the computer and rate them by the amount of space and their price. When should which be used.


Add the binary numbers 100101 and 101001 and convert them to decimal (they are unsigned integers). What are possible issues when adding the numbers?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2024

Terms & Conditions|Privacy Policy