Logo

dev-resources.site

for different kinds of informations.

Binary

Published at
9/13/2023
Categories
binary
Author
mkrtich
Categories
1 categories in total
binary
open
Author
7 person written this
mkrtich
open
Binary

Hello, my name is Mkrtich.

Today, I will write about what binary numbers are, how to convert numbers into other bases, and about operations using binary numbers.
First of all, binary is the fundamental in computing. There are only two symbols in binary, 1 and 0, so we can say that binary is just a base-2 numbering system. Each number in binary represents a bit, and 8 bits together form a bite.
Next, we can discuss converting a decimal number into another base.
Divide the decimal number by the desired base.
Write down the remainder.
Write down the integer quotient.
Repeat steps 1-3 with the integer quotient until it becomes 0.
The remainder, read in reverse order, form the decimal number representation in the desired base.
For example, to convert 27 into binary:

27 ÷ 2 = 13 with a remainder of 1. Write down 1.
13 ÷ 2 = 6 with a remainder of 1. Write down 1.
6 ÷ 2 = 3 with a remainder of 0. Write down 0.
3 ÷ 2 = 1 with a remainder of 1. Write down 1.
1 ÷ 2 = 0 with a remainder of 1. Write down 1.
Reading the remainder from bottom to top gives you the binary representation:

27 in binary is 11011.

Now, let's discuss how to convert a binary number into a decimal number.
Starting from the rightmost digit (the least significant bit) and moving to the left, assign a positional value to each digit, starting with 2^0 for the rightmost digit and increasing the exponent by 1 for each digit to the left.

So, for the binary number 11011:

Start from the rightmost digit: 1 * 2^0 = 1.
Move to the next digit to the left: 1 * 2^1 = 2.
Continue to the next digit: 0 * 2^2 = 0.
Move to the next number: 1 * 2^3 = 8.
Finally, the leftmost digit is 1 * 2^4 = 16.
Now, add up all these values:

1 + 2 + 0 + 8 + 16 = 27

So, the binary number 11011 is equal to the decimal number 27.

Now, let us talk about operations using binary. All operations in binary are done in the same way as they are done with decimal numbers. Here are some examples

1) Addition
Add corresponding bits from right to left, carrying over any 1 that exceeds 1 into the next column. Example:

Image description

2) Binary Subtraction:

Borrow 1 from the next higher column if necessary. Example:

Image description
Explanation: When subtracting in binary, if you can't directly subtract the lower digit from the higher one, borrow 1 from the next higher column.

3) Binary Multiplication:

Multiply each digit in one number by each digit in the other and shift accordingly. Example:

Image description
Explanation: Multiply each digit in the first number by each digit in the second number and shift the results appropriately.

4) Binary Division:

Divide the largest possible portion of the dividend by the divisor and record the quotient. Example:

Image description

Explanation: Divide as you would in decimal division, finding the largest portion of the dividend that can be divided by the divisor.
That's all for today.

binary Article's
30 articles in total
Favicon
How to convert binary to decimal
Favicon
Udder Overflow - Binary Writeup CTF - Pwnedcr2024
Favicon
Maximum Possible Number by Binary Concatenation
Favicon
House robber III
Favicon
Representação numérica na computação
Favicon
Working with Different File Modes and File Types in Python
Favicon
Understanding Decimal to Binary Conversions: A Guide
Favicon
Elixir pattern matching - save your time, similar with the way of our thinking
Favicon
What the hell are Binary Numbers?
Favicon
Solving a Leetcode problem daily — Day 4 | Add Binary
Favicon
Bitwise Sorcery: Unlocking the Secrets of Binary Manipulation
Favicon
Understanding Binary Representation and Finding Binary Gaps in Python
Favicon
Binary Il - Convert URLs to Il and Secure it - Redirect It 🚀
Favicon
How to Trade Binary Successfully
Favicon
How to Learn Quotex Trading With a 1 Minute Strategy
Favicon
Minimum Changes To Make Alternating Binary String Ruby
Favicon
Hi, Im new here 🤗
Favicon
Binary Operators in Golang
Favicon
Number representation systems. Binary operations
Favicon
Binary and other numerical systems
Favicon
How to Convert Binary to Hexadecimal
Favicon
How to Convert Binary to Octal
Favicon
How to Convert Binary to ASCII
Favicon
How to Convert Binary to Decimal
Favicon
How to Convert ASCII to Binary
Favicon
What is a Binary Number?
Favicon
Operations with binary numbers!
Favicon
BINARY NUMBERS, What are they, how to convert into decimal, operations with them
Favicon
Binary
Favicon
From Binary to Natural Language: The Transforming Landscape of Programming Languages

Featured ones: