1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ivanzaharov [21]
2 years ago
12

3. In a 32-bit CPU, the largest integer that we can store is 2147483647. Verify this with a

Computers and Technology
1 answer:
Semenov [28]2 years ago
5 0

Answer:

No, it can't be verified with a pseudocode.

Explanation:

We can not verify this with a pseudocode because the largest integer that we can store in 32-bit integer goes by the formula 2^32 - 1 = 4, 294, 967,295 and this means that it has 32 ones. Or it may be 2^31 - 1 = 2, 147, 483,647 which is a two complement signed integer.

Despite the fact that it can not be verified by using pseudocode, we can do the Verification by writting programs Through some programming language or in plain English code.

In a 32-bit CPU, the largest integer that we can store is 2147483647 because we can store integer as 2^31 and - (2^31 + 1).

You might be interested in
The loop function is similar to range(), but handles the parameters somewhat differently: it takes in 3 parameters: the starting
nexus9112 [7]

Answer and Explanation:

def loop(start, stop, step):

   return_string = ""

   if step == 0:

       step = 1

   if start > stop:  # the bug was here, fixed it

       step = abs(step) * -1

   else:

       step = abs(step)

   for count in range(start, stop, step):

       return_string += str(count) + " "

   return return_string.strip()

5 0
3 years ago
More registers appear to be a good thing, in terms of reducing the total number of memory accesses a program might require. Give
gulaghasi [49]

Answer:

Following is given the answer step by step:

Explanation:

First of all we will write a program using MARIE that will support the statement: Sum = (A + B) - (C + D). All the necessary comments are given in front of each statement:

Load    A                   # variable A will be loaded

Add     B                  # B will be added to A

Store   Temp1         # A + B will be stored in Temp1

Load    C                  # C will be loaded in memory

Add     D                 # D will be added to C

Store   Temp2         # C + D will ge stored in Temp2

Load    Temp1         # Temp1 will be loaded in the memory

Subt     Temp2         # Temp2(A + B) get subtracted from Temp1(A - B)

Store    Sum             # (A + B) - (C + D) will get stored in Sum.

We can see from above program that memory is accessed 9 times. While if C + D get executed first than memory accesses will be reduced to 7.

Above same program could be written using an architecture of 4 registers:

  • R1
  • R2
  • R3
  • R4

The program is as follows:

Load   R1 , A     #A  will be loaded into R1

Load   R2 , B    # B will be loaded into R2

Add     R1 , R2    # R2 gets added to R1 and the result is stored in R1 (A + B)

Load   R3 , C      # C loaded into R3

Load   R4 , D     # D loaded into R4

Add    R3 , R4   # Value in R4 gets added into R3 and R3 becomes (C + D)

                          #no memory accesses required for this operation

Subt   R1 , R4     #R4 (C + D) gets subtracted from R1 (A + B)

                         #no memory accesses required for this operation

Store  Sum        # The recent value will be stored into Sum

Here memory is accessed 5 times in total.

<h2>I hope it will help you!</h2>
8 0
3 years ago
Import java.awt.GridLayout;
Vikki [24]

Answer:

public class ConversionCalculator extends JFrame {

  private JLabel inch_Label, meter_Label, cm_Label, yard_Label;

  private JButton clear, calculate, exit;

  private JTextField inch_tf, cm_tf, meters_tf, yards_tf;

 

  public ConversionCalculator()

  {

     

      exitButtonHandler exitB;

      clearButtonHandler clearB;

      calcButtonHandler calcB;

     

      setTitle("Conversion Calculator");

      setSize(600,200);

      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

     

      //The first layout we use will be 1 row with three columns

      setLayout(new GridLayout(1,3));

     

      //initialize all the components

      inch_Label = new JLabel("Inches");

      meter_Label = new JLabel("Meters");

      cm_Label = new JLabel("Centimeters");

      yard_Label = new JLabel("Yards");

      clear = new JButton("Clear");

      calculate = new JButton("Calculate");

      exit = new JButton("Exit");

      inch_tf = new JTextField("0.00");

      cm_tf = new JTextField("0.00");

      meters_tf = new JTextField("0.00");

      yards_tf = new JTextField("0.00");

 

      JPanel panel1 = new JPanel();

      panel1.setLayout(new GridLayout(2,2));

      JPanel panel2 = new JPanel();

      panel2.setLayout(new GridLayout(2,2));

      JPanel panel3 = new JPanel();

      panel3.setLayout(new GridLayout(3,1));

      panel1.add(cm_Label);

      panel1.add(cm_tf);

      panel1.add(meter_Label);

      panel1.add(meters_tf);

     

      panel2.add(inch_Label);

      panel2.add(inch_tf);

      panel2.add(yard_Label);

      panel2.add(yards_tf);

     

      panel3.add(clear);

      panel3.add(calculate);

      panel3.add(exit);

     

      add(panel1);

      add(panel2);

      add(panel3);

     

     

      exitB = new exitButtonHandler();

      exit.addActionListener(exitB);

     

      clearB = new clearButtonHandler();

      clear.addActionListener(clearB);

     

      calcB = new calcButtonHandler();

      calculate.addActionListener(calcB);

     

      setVisible(true);

  }

 

  //public static void main(String[] args)

     // {

       // new ConversionCalculator();

      //}

 

  private class exitButtonHandler implements ActionListener

  {

      public void actionPerformed(ActionEvent e)

      {

          //exits program

          System.exit(0);

      }

  }

 

  private class clearButtonHandler implements ActionListener

  {

      public void actionPerformed(ActionEvent e)

      {

          //clear button sets all text fields to 0

          inch_tf.setText("0.00");

          meters_tf.setText("0.00");

          yards_tf.setText("0.00");

          cm_tf.setText("0.00");

      }

  }

 

  private class calcButtonHandler implements ActionListener

  {

      public void actionPerformed(ActionEvent e)

      {

          double inches, yards, meters, cms;

          DecimalFormat df = new DecimalFormat("0.00");

         

          //parse strings in textbox into doubles

          inches = Double.parseDouble(inch_tf.getText());

          yards = Double.parseDouble(yards_tf.getText());

          meters = Double.parseDouble(meters_tf.getText());

          cms = Double.parseDouble(cm_tf.getText());

         

          //we check which value has been tampered with and base our conversion off this

          //because of this it is important that the user clears, or else it will do inch conversion

          if(inches != 0.00)

          {

              cms = inches * 2.54;

              meters = cms / 100;

              yards = inches / 36;

             

              cm_tf.setText(df.format(cms));

              meters_tf.setText(df.format(meters));

              yards_tf.setText(df.format(yards));

             

          }

          else if(yards != 0.00)

          {

              inches = yards / 36;

              cms = inches * 2.54;

              meters = cms / 100;

             

              cm_tf.setText(df.format(cms));

              meters_tf.setText(df.format(meters));

              inch_tf.setText(df.format(inches));

          }

          else if(meters != 0.00)

          {

              cms = meters * 100;

              inches = cms / 2.54;

              yards = inches / 36;

             

              cm_tf.setText(df.format(cms));

              inch_tf.setText(df.format(inches));

              yards_tf.setText(df.format(yards));

          }

          else if(cms != 0.00)

          {

              inches = cms / 2.54;

              yards = inches / 36;

              meters = cms / 100;

             

              meters_tf.setText(df.format(meters));

              inch_tf.setText(df.format(inches));

              yards_tf.setText(df.format(yards));

          }

      }

  }

}

Explanation:

  • Inside the action performed method, pass the strings in text box.
  • check if the value has been modified then do the relevant conversions inside the conditional statement.
  • When the user clears, it will not do to the inch conversion.
8 0
2 years ago
According to Amdahl's Law, what is the speedup gain for an application that is 60% parallel and we run it on a machine with 4 pr
rodikova [14]

With four processing cores, we get a speedup of 1.82 times.

<h3>What is Amdahl's Law?</h3>

Amdahl's law exists as a formula that provides the theoretical speedup in latency of the implementation of a task at a fixed workload that can be expected of a system whose resources exist improved.

Amdahl's law exists that, in a program with parallel processing, a relatively few instructions that hold to be completed in sequence will have a limiting factor on program speedup such that adding more processors may not complete the program run faster.

Amdahl's law stands also known as Amdahl's argument. It is utilized to find the maximum expected progress to an overall system when only part of the system exists improved. It is often utilized in parallel computing to indicate the theoretical maximum speed up utilizing multiple processors.

Hence,  With four processing cores, we get a speedup of 1.82 times.

To learn more about Amdahl's Law refer to:

brainly.com/question/16857455

#SPJ4

6 0
1 year ago
Many contemporary languages allow two kinds of comments: one in which delimiters are used on both ends (multiple-line comments),
m_a_m_a [10]

Answer and Explanation:

Multiple-line comments :

Advantage :In the event that we need to remark out of zone of the given program , we can utilize it.

Disadvantage : In numerous line results are in reduced unwavering quality. It stretches out the remark as far as possible of the following comment.For least difficult approach to unintentionally leave off the last delimiter, which successfully expelling code from the program.

Single Line Comments :

Advantage :In the event that you need to close all the delimiter before close the program we utilize this kind of remarks.

Disadvantage : It put more burden on your program .It repeated on every line of a block of comments

3 0
2 years ago
Other questions:
  • After you enter the details for the first selected recipient in the New Address List dialog box, click _______ to add another re
    11·2 answers
  • What happens when the computer is thrashing? quizzlet?
    12·1 answer
  • Write a program in python that ask the user to enter a word and then capitalizes every other letter of that word
    15·1 answer
  • If the predetermined overhead allocation rate is 245% of direct labor cost, and the Baking Department's direct labor cost for th
    13·1 answer
  • Excel spread sheets are primarily used to
    13·2 answers
  • What is a column in a table
    10·2 answers
  • Which is a good way to improve your credit score
    5·1 answer
  • Select three advantages of cloud computing.
    12·1 answer
  • What do you think that the next version of IR (IR 5.0) will bring if it was discovered in near future? (hint:- advance IR 4.0 fe
    8·1 answer
  • How will technology help people with disabilities become more transportation independent?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!