mirror of
https://github.com/Comp211-SP24/lab-05-Rushilwiz.git
synced 2025-04-18 19:00:17 -04:00
idt it committed
This commit is contained in:
parent
f4a9616adc
commit
da785a1c9d
12
cache.c
12
cache.c
|
@ -102,18 +102,6 @@ int cread(unsigned int cmf, unsigned int* hex_addr, bool* hit, bool* replace) {
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_binary(unsigned char num) {
|
|
||||||
// Start from the most significant bit (MSB) and move to the least
|
|
||||||
// significant bit (LSB)
|
|
||||||
for (int i = 7; i >= 0; i--) {
|
|
||||||
// Use bitwise AND to isolate the specific bit and shift right to get 1
|
|
||||||
// or 0
|
|
||||||
int bit = (num >> i) & 1;
|
|
||||||
printf("%d", bit);
|
|
||||||
}
|
|
||||||
printf("\n"); // Newline after printing the binary number
|
|
||||||
}
|
|
||||||
|
|
||||||
void cprint() {
|
void cprint() {
|
||||||
unsigned int line;
|
unsigned int line;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user