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

1369 Views

See similar Computing IB tutors

Related Computing IB answers

All answers ▸

Define the terms CU and ALU and briefly explain their roles in the CPU.


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


What is data validation and data verification?


The program I've written doesn't do what its supposed to! I don't have any errors, so I don't even know where to start looking for the problem. Where can I begin?


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–2025

Terms & Conditions|Privacy Policy
Cookie Preferences