answer.
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
antoniya [11.8K]
1 year ago
11

Write the 8-bit signed-magnitude, two's complement, and ones' complement representations for each decimal number: +25, + 120, +

82, -42, -111.
Computers and Technology
1 answer:
pshichka [43]1 year ago
6 0

Answer:

Let's convert the decimals into signed 8-bit binary numbers.

As we need to find the 8-bit magnitude, so write the powers at each bit.

      <u>Sign -bit</u> <u>64</u> <u>32</u> <u>16</u> <u>8</u> <u>4</u> <u>2</u> <u>1</u>

+25 - 0 0 0 1 1 0 0 1

+120- 0 1 1 1 1 0 0 0

+82 - 0 1 0 1 0 0 1       0

-42 - 1 0 1 0 1 0 1 0

-111 - 1 1 1 0 1 1 1 1

One’s Complements:  

+25 (00011001) – 11100110

+120(01111000) - 10000111

+82(01010010) - 10101101

-42(10101010) - 01010101

-111(11101111)- 00010000

Two’s Complements:  

+25 (00011001) – 11100110+1 = 11100111

+120(01111000) – 10000111+1 = 10001000

+82(01010010) – 10101101+1= 10101110

-42(10101010) – 01010101+1= 01010110

-111(11101111)- 00010000+1= 00010001

Explanation:

To find the 8-bit signed magnitude follow this process:

For +120

  • put 0 at Sign-bit as there is plus sign before 120.
  • Put 1 at the largest power of 2 near to 120 and less than 120, so put 1 at 64.
  • Subtract 64 from 120, i.e. 120-64 = 56.
  • Then put 1 at 32, as it is the nearest power of 2 of 56. Then 56-32=24.
  • Then put 1 at 16 and 24-16 = 8.
  • Now put 1 at 8. 8-8 = 0, so put 0 at all rest places.

To find one’s complement of a number 00011001, find 11111111 – 00011001 or put 0 in place each 1 and 1 in place of each 0., i.e., 11100110.

Now to find Two’s complement of a number, just do binary addition of the number with 1.

You might be interested in
Escribe, en los siguientes cuadros, los conceptos que correspondan
Fofino [41]

Answer:

Débito o debe                                                         Crédito o haber

Préstamo de la cooperativa                                          Efectivo

Gasto de arriendo                                              Cuentas por cobrar

Cuentas por pagar                                          Documentos por cobrar

Gasto de publicidad                                                Capital social

Hipoteca por pagar                                                       Ventas

Intereses pagados            Bancos (en el caso de cobros a través de bancos)

Bancos (en el caso que deba productos bancarios)

Explanation:

3 0
2 years ago
Write a algorithm to attend birthday party​
kolezko [41]

Answer:

2     No

5 14    Yes

Explanation:

8 0
1 year ago
Read 2 more answers
As an information user you should be skeptical of
Sati [7]
I should be skeptical of the credibility of sources that I have during the gathering. Be cautious and make sure that data comes of from trusted specialized sources. Trusted sources can be easily identified for their popularity on certain fields. Determine the purpose of the site and the data it contains.
5 0
2 years ago
You are given an array x of string elements along with an int variable n that contains the number of elements in the array. You
Slav-nsk [51]

Answer:

The code to this question can be given as:

Code:

int i,j,count_previous=0,count_next=0; //define variable

for (j=0; j<n; j++) //loop for array

{

if (x[0]==x[j]) //check condition

{

count_previous++; //increment value by 1.

}

}

for (i=0; i<n; i++) //loop

{

for (j=0; j<n; j++)

{

if (x[i]==x[j]) //check condition

{

count_next++; //increment value by 1.

}

}

if (count_previous>count_next) //check condition

{

mode=x[i-1];

}

else

{

mode=x[i];

count_previous=count_next; //change value.

count_next= 0 ; //assign value.

}

}

Explanation:

In the question it is define that x is array of the string elements that is already define in the question so the code for perform operation in the array is given above. In the code firstly we define the variable that is i, j, count_previous, count_next. The variable i,j is used in the loop and variable count_previous and count_next we assign value 0 that is used for check the values of array. Then we define the for loop in this loop we use conditional statement in the if block we check that array of zero element is equal to array of j value then the count_previous is increase by 1. Then we use nested loop It is also known as loop in a loop. In this first loop is used for array and the second loop is used for check array element.In this we use the condition that if array x of i value is equal to array x of j then count_next will increment by 1.Then we use another condition that is if count_previous is greater then count_next then mode of x is decrement by 1. else mode equal to array and count_previous holds the value of count_next and count_next is equal to 0.

8 0
1 year ago
#A year is considered a leap year if it abides by the #following rules: # # - Every 4th year IS a leap year, EXCEPT... # - Every
lara [203]

Answer:

To check if the year comes under each 100th year, lets check if the remainder when dividing with 100 is 0 or not.

Similarly check for 400th year and multiple 0f 4. The following C program describes the function.

#include<stdio.h>

#include<stdbool.h>

bool is_leap_year(int year);

void main()

{

int y;

bool b;

 

printf("Enter the year in yyyy format: e.g. 1999 \n");

scanf("%d", &y);     // taking the input year in yyyy format.

 

b= is_leap_year(y);  //calling the function and returning the output to b

if(b==true)

{

 printf("Thae given year is a leap year \n");

}

else

{

 printf("The given year is not a leap year \n");

}

}

bool is_leap_year(int year)

{

if(year%100==0)   //every 100th year

{

 if(year%400==0)   //every 400th year

 {

  return true;

 }

 else

 {

  return false;

 }

}

if(year%4==0)  //is a multiple of 4

{

 return true;

}

else

{

 return false;

}

}

Explanation:

Output is given as image

5 0
1 year ago
Other questions:
  • Janice is unsure about her future career path she has grown up on her family farm but she is also interested in medicine Janice
    5·1 answer
  • Fill in the blank; "As well as their traditional role of computing data, computers are also extensively used for..."
    14·1 answer
  • A key field is used to _____. enter a password uniquely identify records merge data list the most important information
    12·2 answers
  • Given an alphabet, print all the alphabets up to and including the given alphabet.
    15·2 answers
  • The code selection above is taken from the Color Sleuth activity you just completed. This selection would count as an abstractio
    12·1 answer
  • 14. Emelia is very concerned about safety and has conducted a study to determine how many bike helmets were replaced at each loc
    13·2 answers
  • Probability of theft in an area is 0.03 with expected loss of 20% or 30% of things with probabilities 0.55 and 0.45. Insurance p
    5·1 answer
  • Television broadcasts were originally delivered by using which technology
    14·1 answer
  • 1-(50 points) The function sum_n_avgcomputes the sum and the average of three input arguments and relays its results through two
    8·1 answer
  • How does Accenture help companies harness the power of data to achieve optimal business outcomes?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!