MIPS - Making a 64 bit number when you only have 32 bit register support

  • Thread starter Thread starter Kerren
  • Start date Start date
  • Tags Tags
    Bit Mips Support
AI Thread Summary
The discussion revolves around the challenge of creating a 64-bit number using only 32-bit registers in MIPS. The user has attempted several methods, including using an "overflow" register to track overflow during addition, but found it ineffective due to binary representation differences. They also explored allocating memory for the result but faced issues with dereferencing in the add function, limiting their approach. Another idea involved manipulating binary input and shifting bits, but uncertainty about creating a binary variable arose. The user seeks advice on linking registers to form virtual 64-bit registers and welcomes additional suggestions for overcoming these limitations.
Kerren
Messages
9
Reaction score
0
Hey guys I've been working on this program for just over a week now and I just can't seem to find any way around my problem. The problem I'm having is:

I'm trying to add 32 bit numbers together and if there is an overflow then I'd like to find a way to output the result as a 64 bit number.

I had a couple of ideas (as of yet, none of them have worked :biggrin:) so here they are:

  1. My first bright idea :biggrin:
    I tried to add numbers together and when there was an overflow I'd increment another register (lets call it the "overflow" register). Once the calculation was done I would just output the overflow register next to the other register to make a "64 bit" number :smile: In theory this would work IF we were working in decimal (base 10) because when there is an overflow a digit is added to the front of the result, however, in binary there is not always a whole new digit added to the front of the result so this didn't work for me and I got some pretty funny answers :smile:!
  2. The second idea
    I tried to allocate 8 bytes in the heap memory block and just save the result to that. The problem I had is that I can't dereference that allocated memory in the actual add function. This means that I have to use an intermediate register for calculating the result and then I would copy this intermediate register to the allocated memory. This defeats the point of the allocated memory because the intermediate register is only 32 bits :smile:
  3. The third (untested) idea
    I want to read in an actual binary input and then I can shift the bits and if there is an overflow I add them to a new binary number (the overflow register) and then output both the overflow register and the result register together to form a 64 bit number. The problem I'm having is that I don't actually know how to make a binary variable (is there even such a thing as a "binary variable" :biggrin:??)
  4. The fourth idea
    I tried to use the $f register because it looks to me like they are 64 bit registers but it seems like they are private registers that I cannot access. Does anyone know any way around this?
  5. Other thoughts
    Is there any way to link registers together so that they can form virtual 64 bit ones (I know that's a really hopeful thought :smile:)?

    Also does anyone have any other ideas on how to make a 64 bit system using only 32 bit registers?

Thanks guys!
 
Engineering news on Phys.org
I'm an idiot! I thought I put this in the course work section :)! Can we move this quick?
 
Hey guys. I have a question related to electricity and alternating current. Say an alien fictional society developed electricity, and settled on a standard like 73V AC current at 46 Hz. How would appliances be designed, and what impact would the lower frequency and voltage have on transformers, wiring, TVs, computers, LEDs, motors, and heating, assuming the laws of physics and technology are the same as on Earth?
While I was rolling out a shielded cable, a though came to my mind - what happens to the current flow in the cable if there came a short between the wire and the shield in both ends of the cable? For simplicity, lets assume a 1-wire copper wire wrapped in an aluminum shield. The wire and the shield has the same cross section area. There are insulating material between them, and in both ends there is a short between them. My first thought, the total resistance of the cable would be reduced...
I used to be an HVAC technician. One time I had a service call in which there was no power to the thermostat. The thermostat did not have power because the fuse in the air handler was blown. The fuse in the air handler was blown because there was a low voltage short. The rubber coating on one of the thermostat wires was chewed off by a rodent. The exposed metal in the thermostat wire was touching the metal cabinet of the air handler. This was a low voltage short. This low voltage...
Back
Top