0

I'm currently working a project where I use MARIE Assembly Language to create a version of Hamming code. My initial work has been to first have the user input the 8 bits for the data bits, and to then have the program output the correct 12-bit code word.

In order to find the correct values for the parity bits, I thought that the easiest way might be to load each data bit, which corresponds to a certain parity bit, and to count the number of 1s. However, I have yet to have found a way to have Marie count bits. I know there is no direct instruction to make Marie count bits, but does anyone have any advice on which instruction(s) might lead me towards an answer? I apologize in advance if clarity is lacking, and if it is please let me know so I can edit my question accordingly.

giotto1
  • 49
  • 5
  • MARIE has very limited instructions, but it is complete in that any operation you can think of in C can also be done, even if it takes a loop. So, do it in C first, so you get a sense of the algorithm you need, as C cannot count bits in one operation either (modulo non standard extensions like popcount). – Erik Eidt Nov 20 '21 at 13:47
  • Unfortunately I'm not too familiar with C yet, however I will take your advice and try running the code through Java first to see what kind of mechanisms are needed. Thank you! – giotto1 Nov 21 '21 at 04:00

0 Answers0