ECE 421-Week 2
ECE 421-Week 2
ECE 421-Week 2
Addition
➢ The four basic rules for adding binary digits (bits) are as
follows:
0+0=0 Sum of 0 with a carry of 0
0+1=1 Sum of 1 with a carry of 0
1+0=1 Sum of 1 with a carry of 0
1 + 1 = 10 Sum of 0 with a carry of 1
Subtraction
➢ The four basic rules for subtracting bits are as follows:
0-0=0
1-1=0
1-0=1
10 - 1 = 1 0 - 1 with a borrow of 1
Binary Arithmetic
Multiplication
➢ The four basic rules for multiplying bits are as follows:
0*0=0
0*1=0
1*0=0
1*1=1
Division
➢ Division in binary follows the same procedure as
division in decimal
Conversions between Binary and Decimal
Multiplication
➢ Direct addition: add the multiplicand a number of times
equal to the multiplier.
➢ Partial products
Step 1: Determine if the signs of the multiplicand and
multiplier are the same or different.
➢ Step 2: take the 2’s complement of the multiplier
➢ Step 3: Starting with the least significant multiplier bit,
generate the partial products.
Step 4: Add each successive partial product to the sum
of the previous partial products to get the final product.
Step 5: If the sign bit that was determined in step 1 is
negative, take the 2’s complement of the product. If
positive, leave the product in its true form.
Arithmetic Operations with Signed Numbers
Division
➢ Step 1:Determine if the signs of the dividend and
divisor are the same or different. The quotient is initially
zero.
➢ Step 2: Subtract the divisor from the dividend using 2’s
complement addition. If this partial remainder is
positive, go to step 3. If the partial remainder is zero or
negative, the division is complete.
➢ Step 3: Subtract the divisor from the partial remainder
and add 1 to the quotient. If the result is positive, repeat
for the next partial remainder. If the result is zero or
negative, the division is complete.
Hexadecimal Number System
Binary to Hexadecimal
➢Break the binary number into 4-bit groups,
starting at the right-most bit, and replace each 4-
bit group with the equivalent hexadecimal
symbol.
Hexadecimal to Binary
➢Replace each hexadecimal symbol with the
appropriate four bits
Conversions: Decimal, Binary and Hexadecimal
Hexadecimal to Decimal
➢ Convert the hexadecimal number to binary and
then convert from binary to decimal.
➢Multiply each hexadecimal digit by its weight and
then take the sum of these products.
Decimal to Hexadecimal
➢Repeated division of a decimal number by 16.
Octal Number System