Lecture Computer organization and assembly language - Lecture 03: Data Representation 2

This chapter presents the following content: Electronic ones and zeros, transistors, CMOS transistors, inverter gate, NOR gate, NOR gate - Operation, OR gate, NAND & AND Gates, logic gates & symbols, De Morgan’s Law,.and other contents. | CSC 221 Computer Organization and Assembly Language Lecture 03: Data Representation 02 Lecture 02: Review Data Representation Decimal Representation Binary Representation Two’s Complement Hexadecimal Representation Lecture Outline Data Representation Binary Multiplication Binary Division Floating Point Representation Binary Multiplication Multiplication follows the general principal of shift and add. The rules include: 0 * 0 = 0 0 * 1 = 0 1 * 0 = 0 1 * 1 = 1 Binary Multiplication EXAMPLE 1 Complete 15 * 5 in binary. Convert to binary 15 = 000011112 5 = 000001012 Ignore any insignificant zeros. 000011112 000001012 x Binary Multiplication EXAMPLE 1 Multiply the first number. 1 1 1 12 1 0 1 2 1 1 1 1 Now this is where the shift and takes place. x 1111 x 1 = 1111 Binary Multiplication EXAMPLE 1 Shift one place to the left and multiple the second digit. 1 1 1 12 1 0 1 2 1 1 1 1 0 0 0 0 0 x 1111 x 0 = 0000 Shift One Place Binary Multiplication EXAMPLE 1 Shift one place to the left and . | CSC 221 Computer Organization and Assembly Language Lecture 03: Data Representation 02 Lecture 02: Review Data Representation Decimal Representation Binary Representation Two’s Complement Hexadecimal Representation Lecture Outline Data Representation Binary Multiplication Binary Division Floating Point Representation Binary Multiplication Multiplication follows the general principal of shift and add. The rules include: 0 * 0 = 0 0 * 1 = 0 1 * 0 = 0 1 * 1 = 1 Binary Multiplication EXAMPLE 1 Complete 15 * 5 in binary. Convert to binary 15 = 000011112 5 = 000001012 Ignore any insignificant zeros. 000011112 000001012 x Binary Multiplication EXAMPLE 1 Multiply the first number. 1 1 1 12 1 0 1 2 1 1 1 1 Now this is where the shift and takes place. x 1111 x 1 = 1111 Binary Multiplication EXAMPLE 1 Shift one place to the left and multiple the second digit. 1 1 1 12 1 0 1 2 1 1 1 1 0 0 0 0 0 x 1111 x 0 = 0000 Shift One Place Binary Multiplication EXAMPLE 1 Shift one place to the left and multiple the third digit. 1 1 1 12 1 0 1 2 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 x 1111 x 1 = 1111 Shift One Place Binary Multiplication EXAMPLE : Add the total of all the steps. 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 1 0 0 1 0 1 1 Convert back to decimal to check. + Binary Division Division in binary is similar to long division in decimal. It uses what is called a shift and subtract method. Binary Division EXAMPLE : Complete 575 / 25 using long division. 25 575 Take the first digit of 575 (5) and see if 25 will go into it. If it can not put a zero above and take the next number. 25 575 How many times does 25 go into 57? TWICE 0 02 Binary Division 25 575 50 7 How much is left over? 57 – (25 * 2) = 7 25 575 50 75 Drop down the next value 02 02 Binary Division 25 575 50 75 Divide 75 by 25 Result = 3 25 575 50 75 75 0 Check for remainder 75 – (3 * 25) = 0 FINISH! 023 023 Binary Division Step 1: Convert both numbers to binary. 25 = 1 1 0 0 1 5 = 1 0 1 Step 2: Place the numbers accordingly: 1 0 1 1 1 0 0 1 .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
476    16    1    24-11-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.