Operations on data Flashcards
What are the values of logic operations at bit level?
0 or 1
Name four bit-level operations
NOT, AND, OR and XOR
What is the NOT operator?
It outputs the complementary of the input bit e.g.
not 1 = 0
What is the AND operator?
The output is 1 if both inputs are 1 otherwise it outputs 0
What is the OR operator?
The output is zero if both inputs are zero otherwise the output is 1.
What is the XOR operator?
Its similar to the OR operator however when both inputs are the same it outputs 0 and will output 1 if both inputs are different
Are logic operations at pattern level the same as bit-level?
Yes
What is it called when using a NOT operator to convert a bit pattern to its opposite?
Complementing (NOT is also known as one’s complement operation)
What is a mask?
When you unset the corresponding bits in the first set
Name two types of logical shift operations?
Simple shift and circular shift
What is a simple shift?
It shifts each bit right/left and the rightmost/leftmost bit is lost and replaced with a 0.
What is a circular shift?
Shifts (rotates) all the bits left/right and the end bit will be passed to the beginning of the pattern.
What is the right Arithmetic shift operation?
It assumes the bit pattern is a Signed Integer in Two’s complement format and is used to divide an integer by 2. It shifts the bits to the righty and makes a copy of the sign and loses the rightmost bit.
e.g. 10010 -> 11001 ( the first 1 is replaced with the bit in the second position).
What is the left Arithmetic shift operation?
Is used to multiply an integer by 2. It shifts all the bits to the left and loses the sign. If the sign bit is the same it’s successful but if it’s different an overflow/underflow will occur and the result will not be valid.
11011-> 10110 succesful
10111->01110 unsuccesful
Name arithmetic operations?
adding, subtracting, multiplying, and dividing
what is (X^_+1) mean if its value was originally x?
Twos complementary of X
what is (X^_+1)?
Twos complement of X
What are the 3 categories of operations on data
Logic operations, shift operations, and arithmetic operators
Boolean algebra deals with constants, variables, and operators. Give e.g.
Constants only use the constants 0 and 1.
We use letters for variables e.g. x,y,z
3 basic operators are NOT, AND, and OR
How do we represent NOT, AND and OR
NOT x = x’
x and y = x.y
x or y = x+y