Username:
Password:
Remember me:
Register

Back to forum: Programming (Python, Java, Delphi/Pascal, C, VB, etc)


Search forums via Google


0 Users appreciate this thread.

Binary Math: Lesson 1
Started by doggle1
(2013-05-16 05:51:34)
SPCOxion (2013-05-16 07:11:39)
Converting B10 to B2:

NOTE: 1 bit = 1 digit

Step one: Find out how many bits you will need. This is harder to explain than it is to do. The number you want to convert to B2/binary will be called X, and we'll have another number called Z.
Basicially, Z will tell us how many bits we'll need. When you begin, Z will be 1. Continue multiplying Z by 2 until Z is larger than X.

Step two: Preparing. Okay, so this part is a little bit harder. I suggest getting a pen and paper, or maybe opening up Notepad or something. What I want you to do is to take Z and write it down. Draw a line to the right of it, divide Z by 2, then write Z (after you divided it) beside the line. Continue doing that until Z is 1.

Step three: Converting. This part is very easy. Depending on how big X is, that line of numbers that you wrote down earlier should look something like this:

128|64|32|16|8|4|2|1

Now, take X, and find the biggest number that is smaller than X. Below that number, write a 1. (I'll be using 92 as an example)

128|64|32|16|8|4|2|1
.0.|1.|

Now, take X, and take away the number with a 1 under it. Then continue finding the biggest number that's smaller than X, write a 1 under that number, subtracting, until X is 0.

128|64|32|16|8|4|2|1
.0.|1.|0.|1.|1|1|0|0

So, 92 is 01011100.
djl12328 (2013-05-18 09:56:59)
I already made a tutorial on this. Stop copying me doggle! Unless you're going to be more descriptive than I was. If you are, then by all means, go ahead and keep making them.
www.dark-isle.weebly.com
SPCOxion (2013-05-19 18:13:15)
Pfft, of course I'm not.

I don't even know much PHP, let alone [My]SQL.
@Blender
 

Log in to submit a comment

This topic's ID: 46398

Back to forum: Programming (Python, Java, Delphi/Pascal, C, VB, etc)




Total registered users: 8321
New registered users today: 7
Newest registered user: ElegantVulpes

©  Copyright 2026 3DSPlaza. All Rights Reserved