Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi! I asked this question before but I believe I either received the wrong answer, or maybe I didn't understand it. I'm trying to calculate

Hi! I asked this question before but I believe I either received the wrong answer, or maybe I didn't understand it. I'm trying to calculate the following questions using machine language.

1. 24-12 2. -125-30

I was told that I should convert the numbers to 2 complement binary form in order to calculate it. But the what? Do I turn the birnary numbers into hex numbers? This is what I did at first:

image text in transcribed

image text in transcribed

But if I do follow the suggestion and turn lets say -125 and -30 it will look like this:

-125=1000 0011 in binary 2 com=83 in hex -30=1110 0010 in binary 2 com=E2 in hex

image text in transcribed

But is this really the right way to go?

If I solve question 1 this way I get the right answer. When it's suppost to be FFF4 instead of just F4 for -12.

image text in transcribed

I feel like I'm doing this all wrong. I don't understand how I'm suppost to do this. Below there is a list of the codes.

image text in transcribed

CPU Memory U Memory Control Unit Memory CPU Memory Control Unit 1R:XY Load register R with bit pattern in memory cell with adress XY 2R:XY Load register R with bit pattern XY 3R:XY Store bit pattern in register R in memory cell with adress XY 40:RS Move bit pattern in register R in register S 5R:ST Add bit pattern in register S and T. Put the result in register R. Bit pattern is supposed to be in 2-complement. 6R:ST Add bit pattern in register S and T. Put the result in register R. 7R:ST OR the bit patterns in register S and T. Put the result in register R. 8R:ST AND the bit patterns in register S and T. Put the result in register R. 9R:ST XOR the bit patterns in register S and T. Put the result in register R. AR:OX Rotate bit pattern in register R one bit to the right X times. BR:XY Jump to memory cell with adress XY if bit pattern in register R is equal to bit pattern in register 0 . Co:00 Halt the program DR:0X Shift bit pattern in register R one bit to the left X times. ER:OX Shift bit pattern in register R one bit to the right X times

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

Explain how the process of dialysis cleanses the blood?

Answered: 1 week ago

Question

explain what is meant by the terms unitarism and pluralism

Answered: 1 week ago