-
What is 16 bit in different contexts ?
Refers to the number of bits that can be processedor transmitted in parallel, or the number of bits usedfor single element in a data format. The term is oftenapplied to the following: microprocessor: indicates the width of the registers. A 16-bit microprocessor can process data and memory addresses that are represented by 16 bits. bus…
-
Algorithms: bit manipulation
-
How to find out if nth bit of a number is set to 1?
#include <stdio.h> int main() { int val1 = 4; int val2 = 18; int mask = 1; /* mask <<= 4; */ mask = mask << 4; printf(“mask is %d\n”,mask); if ( val1 & mask ) { printf(“Bit 5 in val1 is set\n”); } if (val2 & mask ) { printf(“Bit 5 in val2 is…