Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert HEX values to BIN - Inconsistency in the format of numbers #35

Closed
AlessandroGrassi99 opened this issue Sep 7, 2022 · 6 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@AlessandroGrassi99
Copy link
Member

Many values are written in hexadecimal format (like 0x0B_00_00_00), and a few others in binary format (like 0b1110_1010_0000_0000_0000_0000_0111_1111). It would be useful to standardize all values in binary, for readability reasons.

However, I think it is better to close #33 first because it would allow the removal of many values.

@AlessandroGrassi99 AlessandroGrassi99 added the good first issue Good for newcomers label Sep 7, 2022
@FedericoBruzzone
Copy link
Contributor

I'll take this issue

@FedericoBruzzone
Copy link
Contributor

FedericoBruzzone commented Sep 7, 2022

Is it correct to also change the values of the instructions and conditions in binary?
(e.g. 0x0 to 0b0000)

from alu_instruction.rs file:
Immagine 2022-09-07 235402

from condition.rs file:
Immagine 2022-09-08 010818

@simo498
Copy link
Contributor

simo498 commented Sep 7, 2022

I think in many cases hexadecimal is clearer than binary and vice versa. (ie: working with addresses in hex and working with bits/bitwise ops/masks in binary

@FedericoBruzzone
Copy link
Contributor

I think like you.

But, to make all the code more readable, I would use hex in the parts as in these screenshots and bin in all other cases (also addresses).

Let's see what others say 👍

@AlessandroGrassi99
Copy link
Member Author

Is it correct to also change the values of the instructions and conditions in binary?
(e.g. 0x0 to 0b0000)

from alu_instruction.rs file:
Immagine 2022-09-07 235402

from condition.rs file:
Immagine 2022-09-08 010818

Nope. In the case of ALU instructions are expressed in hexadecimal in the documentation.

The main work would be to translate the masks and of the (main) instructions. So mainly where bit manipulation and control is required.

@FedericoBruzzone
Copy link
Contributor

I think this issue could be closed (with #41)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants