Professional Documents
Culture Documents
Operation On Data
Operation On Data
OPERATIONS ON
DATA
INTRODUCTION
In this chapter, we show how to operate on data stored in a computer. Operations on data can be divided into three broad
categories: logic operations, shift operations, and arithmetic operations.
• XOR: Trả về 1 khi hai bit khác nhau, và 0 khi giống nhau.
Logic operations at bit level
Example: Use the AND operator on the bit patterns 10011000 and 00101010.
Logic operations at pattern level
Example: Use the OR operator on the bit patterns 10011001 and 00101110.
Example: Use the XOR operator on the bit patterns 10011001 and 00101110.
Logic operations at pattern level
Figure 4.3 shows the simple right shift and simple left shift operations for an 8-bit
pattern
SHIFT OPERATIONS
Circular shift
Figure 4.4 shows the circular shift left and circular shift right operation
SHIFT OPERATIONS
Arithmetic shift operations
• Tất cả các phép toán số học như cộng, trừ, nhân và chia đều có thể được áp dụng cho các số thực được lưu trữ trong định
dạng dấu chấm động (floating-point)
• Phép nhân của hai số thực liên quan đến phép nhân của hai số nguyên trong biểu diễn dấu và giá trị tuyệt đối
• Phép chia của hai số thực cũng liên quan đến phép chia của hai số nguyên trong biểu diễn dấu và giá trị tuyệt đối
THANK YOU!