Search the Community
Showing results for tags 'binary'.
-
The conversion of IP addresses (Decimal) and Binary
BSpendlove posted a blog entry in Server and Networking Blog
This is a revision of a previous blog I posted on my website with better examples and hopefully more depth into the world of binary for IP addresses and Subnetting. I will not explain how to subnet in this article but will explain why you might need to know how to convert binary to decimal (vice versa) and why it is useful. Let's dive straight into the deep end. Binary Binary can be represented as either 1 or 0 (On or Off). We will be using the 'on/off' terms to make it easier to understand how to get the decimal value from our binary expression. An IPv4 Address is constructed from 32 individual binary bits which are split in 8 bit 'sections' also know as octets. (1 octet actually equals 1 byte!) Here is an example: 192.168.0.1 Now you might feel like this isn't so daunting, an address that we are all familiar that is most probably the most commonly assigned IP address to a home router or the first device in our home network. Well, we can explore this IP address in the binary world. The conversion for this IP address is 11000000.10101000.00000000.00000001. You will explore a method used to get this result although right now, we will focus on the structure of this binary format. A little fact is that an IPv6 address is actually created from 128 bits but normally represented in Heaxdecimal format (0-9, A-F = total of 16 values - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F) Structure Representing the above binary result in our '8 bit' or '4 octet'. 8bits.8bits.8bits.8bits (32 bits in total) octet.octet.octet.octet When beginning to learn the conversion, starters will want to proceed to memorize a table and even have a similar table available on screen or a piece of paper to help with the process. Our process to convert our IP address to binary (and vice versa) will start by using this table on each octet (each 8 bits) and then follow with the second, third and finally fourth. In our 8 bits, the bit on our right is our 'least significant bit' and on the right our 'most significant bit'. Don't get caught up too much with the maths expression until we dive deeper into the more subnetting section which will come in a later article. A binary representation of 255 is: 11111111 (We have to add all the decimal values for each bit that is 'on' (1) which adds to 255) If we were to work out 11111110 in decimal value (We would follow the rule to only to add the decimal values of the corresponding binary value that is 'on' or equal to 1) So in the table above, we will only add the binary values equal to 'on' (1) which will result of the decimal number of 254. It would make sense now to try and work out our first octet of 192.168.0.1 As the same concept applies, adding our binary values that are only equal to 'on' (1) will result in a decimal number of 192. (128+64 = 192) 128 + 32 + 8 = 168 00000000 in Binary is 0 in decimal.... Remember that we only add our values when the corresponding binary value is 'on' (equal to 1) 192.168.0.1 So, if we use our 4 tables above that were used to convert our decimal to binary, we will find that this 192.168.0.1 address represented in Binary is: 11000000.10101000.00000000.00000001 Ok that is cool I guess? Although I guess we don't really need to know this since the whole point of the hardware is to automatically do this, and IP addresses are a more friendly way for us humans to use... You are certainly correct, to a degree. A single IP address on its own doesn't really mean much to Network Engineers and such. This is where a subnet mask comes in. Subnet Mask Do you really need to read on? You have already figured out how to convert Decimal to Binary (and vice versa if you just apply it in reverse) but this the part where I explain why learning this can be important in specific job roles and such. Now a subnet mask is not to be confused with 'Subnets' or 'Masking an IP address' or even a robber mask. To simplify a subnet mask, it is an address used to describe the following information about a single IP address: Which part of the IP address is the Network ID Which part of the IP address is used for the Host ID (assigning IP's to devices) If you want to carry on into depth with subnetting,subnet masks and using Binary/Decimal conversions into a bit more depth then feel free to suggest and comment if you would like me to create an article. I plan to create one but not soon! Practising and Questions Using your own table or a similar table as shown in the above demonstrations, work out the following: Convert the following from Decimal to Binary: 192.168.10.210 172.16.34.255 10.32.47.100 192.168.43.77 Convert the following from Binary to Decimal: 11000000.10101000.01000001.00010101 00001010.00100001.00010001.10000011 10110001.11001010.11110000.00101111 How many bits in an Octet? What information does a Subnet masks provide?? How many total bits are in an IPv4 Address? How many total bits are in an IPv6 Address? Convert these binary values and describe where you would commonly find the decimal representation (10000000, 11000000, 11100000, 11110000, 11111000, 11111100, 11111110, 11111111)-
- binary
- ip addresses
-
(and 1 more)
Tagged with:
-
I have a question I've been pondering for the longest time about two's complement negative numbers. I understand the theory behind two's compliment, you take a number, invert it and add 1 to get the negative equivalent of it for mathematical operations. This much makes sense to me and I can see the benefits of using it over signed values or one's complement. The problem I run into is what happens to the number when the computer wants to put it in memory. Suppose a subtraction operation is performed by the computer like 5 - 6, the result being negative 1. This would look like 11111111 in 8 bit binary, my question is what does the computer do when it stores this number in memory to recall that it was a negative 1 and not a 255?
-
I created a keyboard of sorts that takes in input from two buttons for 0s and 1s and it will translate them once you get to a full byte of data. Then with the third button on the right it will send that character (or command such as backspace) to the computer. Not practical in any way but I was bored and wanted to see what you guys thought of it. I also plan on putting it on some perf board so it isn't so.. Ugly.
-
I remember doing a quick way of converting binary to deanery (I think) where it has something to do with halving the deanery number and ignoring the decimal place. (Or sommet along those lines) I know this is very vague but if anyone can tell me the method (Or any quick method) I would appreciate it. Thanks
-
Hi, I'm pretty new to the programming world and I've been given an assignment to extract cdata from xml and then decoding it to binary by using base64 using Visual Studio. For the love of god I've been searching for 5 days on how to do this and I feel like throwing myself off a cliff. Can some kind souls help me with this and explain along the way? Unfortunately, I can't give examples as it is against my companies policy. But the data goes: <?xml version="1.0" encoding="UTF-8"?> <DispatchData> <TransactionId>526</TransactionId> <ContentFormat>CSV</ContentFormat> <Compressed>Y</Compressed> <Data><![CDATA[insert data here]]></Data> </DispatchData> Thanks for taking the time to read this. T.T
-
I just got my shirt yesterday and wondered if anyone else noticed the binary patterns around the platter :p To save you some time the dots are 0 and the lines are 1 If you wanna know what the message is:
-
If you want to participate, then download a png file you will see a low res image with random black and white pixels, except they are not random. Go and search binary to text converter, the black pixel represents 1 and white pixel represent 0. each line of binary starts from left to right. Go ahead and try to convert it to text and you'll see the text. Reply what you got!
-
I have made a highly secured peace of text and I want you all to figure out how to uncover it! You copy the binary from the text file Uncover the text.txt
- 9 replies
-
- binary
- octidecimal
-
(and 2 more)
Tagged with:
-
In a nutshell I have a school project that wants me to convert an entered binary number to a decimal. Program should go something like this: User enters binary number -> binary number is converted one digit at a time -> decimal number is displayed. I am very new to C and programming in general. If you have any tips or snippets of code you could share that would be great. Thanks very much!
-
If someone could tell me how to solve my problem that would be great. Thanks!!! I am working on a project (which I would not and cant disclose information about). I have a PDF as well as ACII which has the raw binary expressed in bits "0 and 1". How could I translate that file back to text efficiently? The reason why I say efficiently is because the ACII file is 22600 pages long full of binary code expressed in bits I am running OSX El Capitan Thanks you to all that can help
-
So I was cruising kickstarter and stumbled across this....headache https://www.kickstarter.com/projects/1784334872/4-dimensional-operating-system/description And I was thinking that as a Comical episode would be a funny addition to either Channesuperfun or the main channel to "Educate" people on....Why this....t..thi...urgh...This video...will not work. To thoes hom are familiar with computer Tech, it could be an amusing...and painfull thing to watch. But to people who may not be computer savvy, it could be wasted money.
- 1 reply
-
- 4th
- dimensional
-
(and 3 more)
Tagged with:
-
Hello people! i know i have already mad a post about this but now im asking how would i solve this problem: 1.5 - 2.0 in binary Thanks everybody!
-
What is an example of a binary operator that may not be overloaded in c++ ?
- 5 replies
-
- c++
- programming
-
(and 4 more)
Tagged with:
-
Hello! can sombody convert and explain how to convert 1.5 to binary Thanks
-
I am doing some homework, and I'm stuck on a single question. I've looked through the relevant chapters but can't figure it out. The question is "which is the default subnet mask value for the addresses whose first octet ranges from 192 to 223?" Possible answers: 255.255.0.0 255.255.255.0 255.0.0.0 254.255.0.0 I want to say the answer is the last one, but I'm not entirely sure. If someone could explain how to find the correct answer I would appreciate it, book is not exactly clear. Edit: I now think the answer is 255.255.255.0 due to an image in the book where the IPv4 Address is 192.168.1.36, and the subnet mask is 255.255.255.0, am I correct?
- 12 replies
-
Hi everybody, I'm struggling with this homework problem. I have to create a java program that lets the user input a binary number, have the program verify that it is truly a binary number, and then have the program count how many 1's are in the number. So far I am thinking I need to declare each number in the binary as a separate variable? Then have the program say hey, this number is good, this number is good, this isn't good, etc, returning it to the beginning if it doesn't pass to re-enter a new binary number? I am pretty much a complete beginner, and am having trouble with what the syntax would look like as well. Any help would be really appreciated! PS: I understand that this involves loops, which is part of the trouble I am having getting down. Here's what I have so far... import java.util.Scanner;import java.text.DecimalFormat;public class BinaryWords {public static void main( String [] args ){int binaryNumber1;int binaryNumber2;int binaryNumber3;int binaryNumber4;int binaryNumber5;int binaryNumber6;int binaryNumber7;int binaryNumber8;int binaryNumber9;int binaryNumber10;int binaryNumberWhole = binaryNumber1 + binaryNumber2 + binaryNumber3+ binaryNumber4 + binaryNumber5 + binaryNumber6 + binaryNumber7+ binaryNumber8 + binaryNumber9 + binaryNumber10;if 1<binaryNumber1<0then final int SENTINEL = binaryNumber1;System.out.println( "This program verifies a binary number"+ "representing a word and then" + "counts how many 1's are in that number");System.out.println("Please enter a binary number representing a word");
- 15 replies
-
- javacounting items
- boolean
-
(and 2 more)
Tagged with:
-
I had 5 minutes so I decided to import steam.exe into adobe audition using 'raw data' import. So here is the result http://youtu.be/HIe0a1atbtk! In 16bit 8000hz I have cut out some static at the start. But it sounds pretty awesome.
-
Hey, i am 13 and i want to start to learn programming, but i do not know what to start with, i do not have anything i want to do specifically now. Also, please tell me how do i get on learning it and what i should do to get better. TIA!!
-
I didn't know where to post this but I have a personal project I'm working on. How can I make an 8x256 decoders out of 4x16 decoders? To have enough pins I'd imagine I need probably 16 or more 4x16 decoders.. Any help or advice would be greatly appreciated. Or an easier way to make an 8x256 decoder?
-
Title says it all, i prefer 140 mm, and as quiet as can be under 12 USD. Thanks!
-
Hey everyone. So today I released my first Android application and I would like to have some feedback on it. Any and all feedback is appreciated. This is a learning experience for me and would like to keep on improving through your feedback and further development. The title basically says it all. The Binary Converter converts between: decimal, octal, hexadecimal and binary. It can also convert from any base n to the main 4 numbering systems. For binary numbers you can convert to 2's and 1's complement. And lastly this app can also teach you how to convert between binary and decimal by hand, for those times when you don't have a converter lying around. Hope you guys can take the time to look at it and let me know what you guys/girls like or dislike about it and what you would like to see implemented in the future. You can download it at https://play.google.com/store/apps/details?id=com.Charle692.BinaryConverter it is completely free with no adds and no nasty permissions. Main Conversion Page How To Page Thanks everyone!
-
Is there any program/app that can get some binary code, and turn it in a black and white image. By that i mean get this image where the 0 are represented by the color black and the 1 with the color white.The example shown well Its a short creepy pasta story from a game. But that doesnt matter, what matters is can i do the same? Or am i gonna have to do it manually?