answersLogoWhite

0

101010

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is binary in R programming?

Binary in R is the same as binary in any other programming language. The language doesn't actually change the meaning of binary any more than it can change the meaning of decimal, octal or hexadecimal. These are all symbolic representations (notations) for digital information. When we see the symbol 42 we instantly recognise it as the value forty-two because we automatically assume numeric symbols are always written in decimal notation. However, the computer represents the value forty-two as 00101010, which is the binary equivalent. In order to present the decimal value to the user, the computer must convert the value 00101010 to the string "42". This is achieved through binary division by ten (00001010 in binary) and taking the remainder: 00101010 / 00001010 = 00000100 r 00000010 00000100 / 00001010 = 00000000 r 00000100 The remainders are decimal 2 and 4 respectively. Now we convert each of these digits to their equivalent ASCII character code by adding 48 (binary 110000), which is the ASCII code for character '0': 00000010 + 00110000 = 00110010 00000100 + 00110000 = 00110100 We output these two ASCII character codes in reverse order, so we now have {00110100, 00110010} which is {52, 50} in decimal. ASCII character code 52 yields '4' while ASCII character code 50 yields '2', which gives us the complete string, "42", which can now be presented to the user. Converting the other way takes the user-input string "42" and stores the value 00101010: First, subtract character code '0' (48 decimal) from each character: 00110010 - 00110000 = 00000010 (50 - 48 = 2) 00110100 - 00110000 = 00000100 (52 - 48 = 4) Multiply each digit by increasing powers of 10: 00000010 * 00000001 = 00000010 (2 * 10^0 = 2) 00000100 * 00001010 = 00101000 (4 * 10^1 = 40) Finally, sum the products: 00000010 + 00101000 = 00101010 (2 + 40 = 42) If we wish to see the binary representation of an integer, R provides the Int2Bin function: >intToBin(42, 8) [1] "00101010" Here we've requested the binary equivalent of the decimal value 42 in 8-bit binary which, as we've already established, outputs the binary value 00101010.


How many binary trees are possible with 5 node?

1..15 (not allowing empty trees).


How big is a barrel of oil?

A barrel of oil in the U.S. is equivalent to 42 gallons.


What is tilde operator in c and how its work?

In C, the tilde operator (~) is the bitwise NOT operator. It returns the ones-complement of its operand. That is, the individual bits of the input are inverted in the output, such that all 0s becomes 1s and all 1s become 0s. Note that the bitwise NOT (~) and logical NOT (!) operators are used for entirely different purposes. With logical NOT, the operator evaluates true (the all-ones bit pattern) when the operand is false (the all-zeroes bit pattern), which is exactly the same as the ones-complement used in bitwise NOT. However, if the operand represents anything other than the all-zeroes bit pattern, the output is the all-zeroes bit pattern. We can compare the two operators by examining what happens to the bits in each operation. Let's use the value 42 (binary 00101010) as the input. ~42 -43 !42 false Note that the binary value 11010101 represents -42 on a ones-complement system. However, most systems today use twos-complement notation for signed values, thus if we want to negate a value regardless of which notation is utilised by the system we must use the unary minus operator. On a twos-complement system, unary minus is equivalent to adding 1 to the ones-complement representation of the operand. Thus -42 is equivalent to (~42) + 1 = (~00101010) + 00000001 = 11010101 + 00000001 = 11010110 = -42.


What is the algorithm for finding the number of binary digits required to represent a positive decimal integer?

Algorithm bit_count is:Input: an integer n, such that n >= 0Output: the minimum number of binary digits (bits) required to represent nlet count := 0;repeat {n := n / 2; // integer division: ignore any remaindercount := count + 1;} until n = 0;return count;This works because each binary digit represents an increasing power of 2, starting from 2^0. Thus if we repeatedly divide a value by 2 until the result is 0, the total number of divisions tells us the minimum number of bits required to represent the value.Take the value 42 as an example:42 / 2 = 2121 / 2 = 10 (r 1)10 / 2 = 55 / 2 = 2 (r 1)2 / 2 = 11 / 2 = 0 (r 1)That's 6 divisions in total so we need at least 6 binary digits to represent 42 in binary. Given that 42 is 101010 in binary, this is correct.Let's try 31:31 / 2 = 15 (r 1)15 / 2 = 7 (r 1)7 / 2 = 3 (r 1)3 / 2 = 1 (r 1)1 / 2 = 0 (r 1)5 divisions so 5 bits. 31 in binary is 11111, so that's also correct. 11111 is also the maximum value we can represent with just 5 bits so it follows that 32 would need 6 bits:32 / 2 = 1616 / 2 = 88 / 2 = 44 / 2 = 22 / 2 = 11 / 2 = 0 (r 1)QED

Related Questions

What is binary conversion of 42to the base 10?

If you mean "How to convert binary 42 to base 10" then it is not valid.Binary numbers have primitive symbols of 0 an 1 and thus 42 is not binary


What is the binary number 101010 in base 10?

To convert the binary number 101010 to base 10, you can use the positional notation method. Starting from the right, the positions represent powers of 2. So, 12^5 + 02^4 + 12^3 + 02^2 + 12^1 + 02^0 = 32 + 0 + 8 + 0 + 2 + 0 = 42. Therefore, the binary number 101010 is equal to 42 in base 10.


What is binary for 42?

42 = 101010


What is 42 in binary?

42 = 101010


What is 42 times 3?

42+42+42 (42*3) is equivalent to 10*4+10*4+10*4+6 that is 12 10s and 6. 12*10 is 120 so the answer to 42*3 is 126.The product is 126


In fraction What is 42 60 equivalent to?

The fraction 42/60 simplifies to 7/10.


What are 2 equivalent fractions to 30 over 42?

30/42 = 5/7 = 10/14


What fraction is equivalent to 42 60?

To find a fraction equivalent to 42/60, we need to simplify it by dividing both the numerator and denominator by their greatest common factor, which is 6. This gives us 7/10. Therefore, the fraction equivalent to 42/60 is 7/10.


What are two equivalent fractions to 42 over 70?

6 over 10


What improper fraction would be equivalent to 4.2?

42/10 or 21/5


What are two equivalent fractions for 5 over 14?

10/28, 15/42


What is 42 million written in standard form?

42 million written in standard form is 42,000,000. In standard form, numbers are expressed in terms of powers of 10. The number 42 million can be written as 42 x 1,000,000, where 1,000,000 is 10^6. Therefore, 42 million in standard form is 42 x 10^6, which is equivalent to 42,000,000.