mirror of
https://github.com/Comp211-SP24/lab-05-Rushilwiz.git
synced 2025-04-08 14:20:21 -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;
|
||||
}
|
||||
|
||||
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() {
|
||||
unsigned int line;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user