1
The commutative property of a binary operator states that the order of the operands does not affect the result. Thus x ^ y = y ^ x where ^ is the binary operator. Addition and multiplication of numbers are two common operators that are commutative. Subtraction and division are two common ones that are not commutative.
Conversion from Binary to Decimal is easy if you use this common method: Assign a decimal value to each place of the binary number starting with 1 at the right-hand digit. Double each decimal value going right to left <== for each remaining binary digit, 1's and 0's. Add up the decimal numbers that correspond to 1's in the binary number. 1, 1, 0, 1, 1, 0, 0, 1 binary 128, 64, 32, 16, 8, 4, 2, 1 = 128+64+16+8+1 = 217 decimal
In software, they're often preceded with "0x". Note that the first character there is a zero, not the letter O.For example:0x10 = 16 in decimal.Other common notations (outside of software) include:101610h
Natural log Common log Binary log
Advantage of bcd are:One advantage of BCD over binary representations is that there is no limit to the size of a number. To add another digit, just add a new 4-bit sequence.Numbers represented in pure binary format are limited to the largest number that can be represented by 8, 16, 32 or 64 bits.Sometimes, the right-most nibble contains the sign (positive or negative).It is easier to convert decimal numbers to and from BCDthan binary and, though BCD is often converted to binary for arithmetic processing, it is possible tobuild hardware that operates directly on BCD.Disadvantage of bcd are:Some operations are more complex to implement. Adders require extra logic to cause them to wrap and generate a carry early. 15-20 percent more circuitry is needed for BCD add compared to pure binary. Multiplication requires the use of algorithms that are somewhat more complex than shift-mask-add (a binary multiplication, requiring binary shifts and adds or the equivalent, per-digit or group of digits is required)Standard BCD requires four bits per digit, roughly 20 percent more space than a binary encoding (the ratio of 4 bits to log210 bits is 1.204). When packed so that three digits are encoded in ten bits, the storage overhead is greatly reduced, at the expense of an encoding that is unaligned with the 8-bit byte boundaries common on existing hardware, resulting in slower implementations on these systems.Practical existing implementations of BCD are typically slower than operations on binary representations, especially on embedded systems,due to limited processor support for native BCD operations.
Decimal, binary, octal and hexadecimal.
In math, that may either refer to changing the base of the number system (for example, change from decimal (base 10) to binary (base 2)); or it may refer to changing logarithms, from one base to another - for example, common (base-10) logarithms to natural (base-e) logarithms.
Hexadecimal and octal systems are used primarily in computing and programming because they provide a more compact representation of binary data. Hexadecimal (base 16) simplifies the representation of binary values, allowing four binary digits to be represented by a single hexadecimal digit, making it easier for humans to read and understand. Octal (base 8), while less common today, was traditionally used in computing due to its straightforward conversion from binary, grouping bits into sets of three. Both systems help streamline coding, debugging, and memory addressing processes.
The Binary system uses only the numbers 1 & 0. The decimal system has "dots" in them example of decimal: 1.25
Binary (base-2) and hexadecimal (base-16) are commonly used by programmers. Binary computers only understand binary encodings. That is, all information (both instructions and data) must be converted into a numeric value; digital information. Humans like to use decimal notation whenever possible, but in order to program a computer in its own native language we must convert all values to binary, the only language the computer actually understands. However, binary is difficult to work with because there are only two symbols: 0 and 1. Decimal, on the other hand, has ten symbols, 0 to 9, so we can easily notate all values from 0 to 9 using just one digit. In binary we would need at least 4 digits to notate the same range of numbers. Thus binary numbers tend to be much longer than their decimal equivalents and are difficult for humans to comprehend; a single digit in the wrong place is much harder to spot. Although we can program the computer to convert decimal notation to native binary, this has a runtime cost because there is no direct conversion between decimal and binary notation. But base-2 is directly related to all bases that are themselves a power of 2. Thus quaternary (base-4), octal (base-8) and hexadecimal (base-16) are all directly related to binary and are therefore more easily converted back and forth than is decimal. We use hexadecimal because it has relatively few symbols (16), and each hex digit maps 1:1 with a group of 4 bits. Since 4 bits is half a byte we call hexadecimal digits nybbles. Since two nybbles make a byte, we can represent any group of 8 bits with just two symbols instead of 8 binary digits. Octal is also used because it allows us to map bits in groups of 3, which can be useful in systems that use a 9-bit byte rather than the more common 8-bit byte, but is also useful when we need to work in base-8 itself.
10 In the hexadecimal number system (commonly referred to as hex), A follows 9 as a digit. In decimal (the common number system), 10 (a two digit number) follows 9.
The commutative property of a binary operator states that the order of the operands does not affect the result. Thus x ^ y = y ^ x where ^ is the binary operator. Addition and multiplication of numbers are two common operators that are commutative. Subtraction and division are two common ones that are not commutative.
Hexadecimal numbers are used in MAC addresses (hardware addresses) in computers. This gives an unlimited number of possible combinations to computer manufacturers. That way each PC in the world has a unique identifier. Esuka Endeley Hexadecimal is a number system using Base 16. It uses the digits from 0 to 9 and the letters from A to F, A=10, B=11, C=12, D=13, E=14, F=15. It enables very large numbers to be written with fewer characters. As computers have very large memories, addressing specific parts of them becomes a big task. Hexadecimal is used as a way of doing so. Sometimes if your computer crashes you will see an error message showing a number with letters in it. Those letters are always between A and F. Basically what it is saying is that there was a problem in memory at this point. Hexadecimal is used in many other ways in computers. One very common purpose is for colour codes in web pages. 6 digits are used, with 2 representing the amount of Red, 2 the amount of Green and 2 for the amount of blue. So if you want a lot of Red, but not much blue or green as a mix for your colour, the code could be something like FF0502. FF represents 255. If you do a web design course, specifically learning to use HTML for creating colours on your pages, you will learn more about this.
Characters are first given an internationally agreed decimal value. The decimal value is converted to binary by the computer. For example... the decimal value for the letter A is 65... this converts to binary as 1000001
Excess-3 code is a type of binary-coded decimal (BCD) that adds 3 to each decimal digit before encoding it in binary. This method simplifies decimal arithmetic operations, such as addition and subtraction, by avoiding the need for carry adjustments that are common in traditional BCD. Additionally, Excess-3 code ensures that all encoded values are positive, making it easier to detect errors and implement digital circuits for decimal numbers. This property enhances reliability in applications like calculators and digital displays.
LXI H, 4150 : Initialize memory pointerMVI B, 08 : count for 8-bitMVI A, 54LOOP : RRCJC LOOP1MVI M, 00 : store zero it no carryJMP COMMONLOOP2: MVI M, 01 : store one if there is a carryCOMMON: INX HDCR B : check for carryJNZ LOOPHLT : Terminate the program
BCD (Binary Coded Decimal) output can be generated using decimal-to-BCD conversion algorithms. One common method involves dividing the decimal number by 10 and storing the remainder as the Binary Coded Decimal digit. This process is repeated until all decimal digits are converted into BCD form. Alternatively, some microcontrollers have built-in instructions to directly convert decimal numbers to BCD format.