+ 6
BoyOfBlu first start out learning what each binary is then as you enter the binary line by line you are instructing certain switch commands based on a series. This is very old school as now we think text to binary verses binary to binary to communicate with machines ... Here is a ruby program which will help you know letter by letter the binary https://sololearn.com/compiler-playground/cjkLlEqLu2yd/?ref=app
11th Sep 2024, 4:29 AM
BroFar
BroFar - avatar
+ 5
If you mean: 1. How do I see, and or write, native binary code for a computer to read. Answer, you don't. Compilers convert your source code into binary and only your computer can make sense of it. (( technically there are ways, but these are very advanced topics )) 2. If you mean to use the binary operators in a data element, such as having bit switches inside a variable, that depends completely on the programming language. But in short, you'll compare your variable using the AND XOR OR operators to compare your bit variables to a mask to see which bits are set or not set. 3. If you mean, how do binary numbers work: Every number is made from bits. For an 8-bit character, you'll have 8 bits. If you only set one of those bits to 1, they will equate to regular numbers like this: In an 8-bit value, setting only one bit at a time results in the following values: Setting the 1st bit (least significant bit): 00000001 = 1 Setting the 2nd bit: 00000010 = 2 Setting the 3rd bit: 00000100 = 4 Setting the 4th bit: 00001000 = 8 Setting the 5th bit: 00010000 = 16 Setting the 6th bit: 00100000 = 32 Setting the 7th bit: 01000000 = 64 Setting the 8th bit (most significant bit): 10000000 = 128 Each value is a power of 2, and it doubles as you move from the least significant bit (on the right) to the most significant bit (on the left). You can then add those numbers together to get different combinations of set bits. For example, setting bit 1 and bit 4 to 1, you can add 8 + 1. The number 9 would equate to 00001001 in binary. To best understand all that, it's good to learn how BASE 2: BINARY, BASE 8: OCTAL, BASE 10:DECIMAL, and BASE 16:HEX numbers work. Learning to count and convert numbers between bases is very useful for programmers. This is an essential skill for hardware programmers who write device drivers, etc.
11th Sep 2024, 2:16 PM
Jerry Hobby
Jerry Hobby - avatar
+ 3
Your question is too general. Binary code of what? Can you provide an example? What coding language? What are you trying to do?
11th Sep 2024, 2:26 AM
Bob_Li
Bob_Li - avatar
+ 3
I don't know anybody that understands machine code. It's interesting, and you can learn a lot, but it would be more worthwhile to use assembly instead. Numeric values are easier to follow in binary. For example, 1011001 You can start from the right to left. It's like saying: (1) * 2^0 + (0) * 2^1 + (0) * 2^2 + (1) * 2^3 + (1) * 2^4 + (0) * 2^5 + (1) * 2^6 = 89 Nonetheless, perhaps this will be of use: https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://yurichev.com/mirrors/machine-code-for-beginners.pdf&ved=2ahUKEwi0qvbU9rmIAxUGhIkEHXjVAWUQFnoECBYQAQ&usg=AOvVaw3S3K2f7A2cptx5yP01aDmj
11th Sep 2024, 3:23 AM
Rrestoring faith
Rrestoring faith - avatar