## Check if the binary representation of a number has equal number of 0s and 1s in blocks

Given an integer N, the task is to check if its equivalent binary number has the equal frequency of consecutive blocks of 0 and 1.… Read More »

## Count numbers have all 1s together in binary representation

Given an integer n, the task is to count the total lucky numbers smaller than or equal to n. A number is said to be… Read More »

## Lucky alive person in a circle | Set – 2

Given that N person (numbered 1 to N) standing as to form a circle. They all have the gun in their hand which is pointed… Read More »

## Sum of decimal equivalent of all possible pairs of Binary representation of a Number

Given a number N. The task is to find the sum of the decimal equivalent of all the pairs formed from the binary representation of… Read More »

## Digital Logic | Binary representations

Binary is a base-2 number system that uses two states 0 and 1 to represent a number. We can also call it to be a… Read More »

## IEEE Standard 754 Floating Point Numbers

The IEEE Standard for Floating-Point Arithmetic (IEEE 754) is a technical standard for floating-point computation which was established in 1985 by the Institute of Electrical… Read More »

## Why are negative numbers stored as 2’s complement?

When doing addition/subtraction on binary numbers in other representations we need to apply different logics (circuits) to perform addition and subtraction. In 2s-complement representation, we… Read More »

## Binary Number System | Overflow in Arithmetic Addition

In computer Architecture 2’s Compliment Number System is widely used. The discussion of overflow here mainly will we with respect to 2’s Complimentary System. N-bit… Read More »

## How the negative numbers are stored in memory?

Prerequisite – Base conversions, 1’s and 2’s complement of a binary number, 2’s complement of a binary string Suppose the following fragment of code, int… Read More »

## Prime Number of Set Bits in Binary Representation | Set 1

Given two integers ‘L’ and ‘R’, write a program to find the total numbers that are having prime number of set bits in their binary… Read More »

## Decimal Equivalent of Gray Code and its Inverse

Given a decimal number n. Find the gray code of this number in decimal form. Examples : Input : 7 Output : 4 Explanation: 7… Read More »

## Binary to Gray code using recursion

Given Binary code of a number as a decimal number, we need to convert this into its equivalent Gray Code. Examples : Input : 1001… Read More »

## Largest number with binary representation is m 1’s and m-1 0’s

Given n, find the greatest number which is strictly not more then n and whose binary representation consists of m consecutive ones, then m-1 consecutive… Read More »

## Decimal representation of given binary string is divisible by 10 or not

The problem is to check whether the decimal representation of the given binary number is divisible by 10 or not. Take care, the number could… Read More »

## Prime Number of Set Bits in Binary Representation | Set 2

Given two integers ‘L’ and ‘R’, we need to write a program that finds the count of numbers having prime number of set bits in… Read More »