Interfacing PIC Microcontrollers 14

Interfacing PIC Microcontrollers 14. Explore in detail microcontroller interfacing techniques using the popular PIC 16F877 Work through step-by-step examples interactively using circuit simulation software, supplied as assembly source code Gain the knowledge of a wide range of peripheral devices such as keyboards, displays, sensors and drives and serial communication with other processors, memory and more Use interactive simulation software to design and test circuits. | Interfacing PIC Microcontrollers 1000 0010 82 -126 1000 0001 81 -127 1000 0000 80 -128 0111 1111 7F -129 0000 0010 02 -254 0000 0001 01 -255 The number obtained by decrementing a register from 0 is called the 2s complement of the corresponding positive number seen in the right column. This method can be used to represent a valid negative subtraction result. For example to calculate 2 7 5 HEX 1 02 - 07 FB -5 BINARY 1 0000 0010 - 0000 0111 1111 1011 The 7 is subtracted from 10216 0216 plus 10016 borrow in to give the 2s complement result. If a positive number is added to a 2s complement negative number the answer is correct if the carry out of the register is ignored. For example to calculate -4 7 3 -4 FC FC 1111 1100 07 0000 0111 1 03 1 0000 0011 2s Complement Conversion The corresponding positive number can be calculated from the 2s complement negative number by applying the process INVERT ALL BITS THEN ADD 1 For example Invert bits Add 1 - 00310 FD 1111 12710 81 1000 -12910 7F 0111 - 25510 01 0000 1101 0000 0001 0111 1111 1000 0001 1111 0010 0000 1110 0111 0000 1000 1110 1111 0011 310 1111 12710 0001 12910 1111 25510 116 Data Processing Conversion to the 2s complement negative form from the positive number is achieved by the inverse process SUBTRACT 1 THEN INVERT ALL BITS For example Subtract 1 1 0000 0001 63 0011 1111 128 1000 0000 255 1111 1111 Invert bits 0000 0000 1111 0011 1110 1100 0111 1111 1000 1111 1110 0000 1111 FF -001 0001 C1 -063 0000 80 -128 0001 01 -255 In this way 2s complement form allows the usual arithmetic operations to be applied to negative binary numbers with the correct result. 255 is the limit of the 8-bit 2s complement range but more bits can be used if necessary. SUMMARY 5 Digital information is stored as numerical or character data A number system uses a base set of digits and column weighting Base 2 10 and 16 are most useful in microsystems BCD and FP numerical formats are often required The decimal equivalent is the sum of .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.