Find the express code that corresponds to the service tag

Assignment Help Computer Engineering
Reference no: EM13986489

Solve the following problems and hand them in at the beginning of class on the due date. You may use a basic calculator, but you must show how you got your answer. 

Write out the solutions neatly. Problems should be in order. Stack the pages neatly with the cover sheet on top and put a single stable in the upper left corner. Make sure the staple does not obscure any of your writing.

Fill in the page numbers of the source code and output for problems 11 and 12 on the cover sheet.

  1. Convert to decimal: 0x2c7b
  2. Convert to binary: 0x2c7b
  3. Convert from decimal to binary: 437
  4. Convert from decimal to hexadecimal: 437
  5. Determine the output of the following code segment (without running it):
    Assume that an int is 32 bits.
    unsigned a = 157;
    unsigned b = 234;
    unsigned c = ~a;
    unsigned d = a & b;
    unsigned e = a | b;
    unsigned f = a ^ b;
    printf("%u %u %u %u %u %u\n",a,b,c,d,e,f);
    
  6. Write a code segment that uses shifts to multiply the unsigned int x by 37.
  7. Using an 8-bit word, find the binary representation of -47 in
    1. two's complement
    2. ones' complement
    3. sign-magnitude
  8. Using a 16-bit word, find the binary representation of -47 in
    1. two's complement
    2. ones' complement
    3. sign-magnitude
  9. Assume that a short is represented by 11 bits and an int is represented by 17 bits.
    What is the output generated by the following code segment:
    int x = 5123;
    int y = -5123;
    short sx = (short)x;
    short sy = (short)y;
    printf("%d %d %d %d\n",x, y, (int)sx, (int)sy);
    printf("%x %x %x %x\n",x, y, (int)sx, (int)sy);
    printf("%u %u %u %u\n",x, y, (int)sx, (int)sy);
    
    You may use a calculator to generate the values, but you must show how you calculated them.
  10. Dell computers have a unique alpha-numeric service tag consisting of digits and upper case letters. When you call Dell technical support, they would like to know the service tag number so that they can appropriately route your call. One way to automate this is to have you type in your service tag number. Since there is no convenient way to uniquely type letters on a standard telephone keypad, Dell also gives you an express code, which is a decimal number calculated from the service tag. The calculation algorithm is simple: the service tag is treated as a base-36 number, where A=10, B=11, etc. 
    Find the express code that corresponds to the service tag: H32Y1F1. You must show how you got your answer.
  11. Write a C program called convert2hex.c that takes a single command line parameter, a decimal number. It starts by outputting your full name. It converts the number to hexadecimal using the method described on the top of page 36 of the text. It outputs the results as it goes along. For each hexadecimal digit it displays a line showing how that digit was created and finally displays a line containing the final result. All output goes to standard output.
    Example:
    If I wrote the program,
    convert2hex 314156
    would generate the following output:
    Abdullah Muzahid
    314156 = 19634 * 16 + 12 (C)
     19634 = 1227 * 16 + 2   (2)
      1227 = 76 * 16 + 11    (B)
        76 = 4 * 16 + 12     (C)
         4 = 0 * 16 + 4      (4)
    0x4CB2C
    
    Note the use of upper case letters and that the equal signs and hexadecimal digits created are lined up.
    You may assume that the number being converted is greater than 0 and less than 263.
    Hint: first write and debug the program, not worrying about lining up the output.
    Run your program with each of the following command line parameters and include the output.
    1. 314156
    2. 2147483647
    3. 11806310474565
    4. 8526495043095935640
  12. Write a C program called convert2base.c that is similar to convert2hex.c, but has 2 command line parameters, the first being an integer in the range 2 though 36, and the second being a decimal number. Instead of converting to base 16, the base used is given by the first parameter.
    Example
    If I wrote the program,
    convert2base 23 314156
    would generate the following output:
    Abdullah Muzahid
    314156 = 13658 * 23 + 22 (M)
     13658 = 593 * 23 + 19   (J)
       593 = 25 * 23 + 18    (I)
        25 = 1 * 23 + 2      (2)
         1 = 0 * 23 + 1      (1)
    12IJM
    
    Run your program with each of the following command line parameters and include the output.
    1. 23 314156
    2. 2 2147483647
    3. 31 263429442133726086
    4. 36 3881091294471582038

Reference no: EM13986489

Questions Cloud

Caclulate the acceleration of the blocks : Sketch a free body diagram for each block, identify all forces acting on the block. Caclulate the acceleration of the blocks. Calculate the tension in the rope.
What is the magnitude of the pushing force : The 10-cm-wide, zero-resistance slide wire shown in (Figure 1) is pushed toward the 1.5 Ω resistor at a steady speed of 0.40 m/s . The magnetic field strength is 0.30 T,  What is the magnitude of the pushing force?
What was ungers net income for 2012 : The following is a list of selected events for Unger Sales and Service for 2012. Unger uses a perpetual inventory system and had a zero inventory balance prior to these transactions. What was Unger's net income for 2012? Compute gross margin for 2012..
Complete the income statement and the balance sheet : Calculate missing amounts, retained earnings, cash, income taxes, income before tax, operating expenses.
Find the express code that corresponds to the service tag : Find the express code that corresponds to the service tag: H32Y1F1. You must show how you got your answer - For each hexadecimal digit it displays a line showing how that digit was created and finally displays a line containing the final result.
Draw the free-body diagram for the block : Draw the free-body diagram for the block. Determine the block's acceleration as it slides down the inclined plane. Is your answer reasonable? Why or why not?
Prepare the intangible assets section of the balance sheet : Patrick Corporation's adjusted trial balance contained the following asset accounts at December 31, 2014: Prepare the intangible assets section of the balance sheet.
Find angle through which it rotated during the acceleration : A disk rotating at 8 rad/s is accelerated at the rate of 1.8 rad/s2 for 7 s. What is its new angular speed? Find the angle through which it rotated during the acceleration.
Explain how to perform task clearly effectively and quickly : Find a mechanism or product around your home and write instructions on how-to install or operate that item. I would like to see at least one graphic in your document. Explain how to perform a task clearly, effectively, and quickly. Adapt to the rea..

Reviews

Write a Review

Computer Engineering Questions & Answers

  Assess the reliability of data gathered via paid internet

assess the reliability of data gathered via paid internet users. describe and assess the evaluation method being used

  Which would create a better product

Which would create a better product

  Identify a problem that may benefit froma sofware

identify a problem that may benefit froma sofware solutionit solution. the staps in the process shoud include1. systems

  Do you know the major differences between the discrete and

question 1 do you know the main differences between a discrete as well as a continuous distribution? question 1 what

  Recommendation on the action that the company needs

Prepare a recommendation on the action that the company needs to take against the offender - Prepare a recommendation on the action that the company needs to take against the offender.

  The open systems interconnection model is inherently

the open systems interconnection model is inherently inefficient. on the source host each layer must take the work of

  Write down the names of five currencies

Write down a C program that displays a title, "Currency Conversion," and then write the names of five currencies and their equivalents to the US dollar. The conversions are hard coded equations.

  Write a program in c++ to calculate body fat and percentage

Write a program in c++ to calculate the body fat and body fat percentage of a person. It must be able to handle gender, use a char data type. Please note that the user may enter f, F, m, M.

  Questionexpand class linkedlisttype by adding following

questionexpand class linkedlisttype by adding following operations-1- inscribe a function noduplicates that insert an

  Find the number of errors that (e,d) will correct

find the number of errors that (e,d) will correct.

  Overview of company and client business case

What is your companys expertise and Ensure that the expertise matches the skill sets required for the business case you have chosen - Overview of Company and Client Business Case

  Why compression algorithms are frequently used in forensics

why Compression algorithms are frequently used in forensics.how they can potentially affect evidence, paying particular attention to algorithms implemented by forensic tools. You need to be clear yet concise.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd