Convert an integer decimal number to a binary number

Assignment Help Assembly Language
Reference no: EM131316487

Binary is a numer system used by computers. It consists of only two digits, 0 and 1, which represent off and on. In decimal numbers, there are ten digits, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. When you write 247 in decimal, it represents (2 x 10^2) + (4 x 10^1) + (7 x 10^0). The same is true in binary, only the base number is ***** instead of ten. Thus, 1101 is (1 x 2^3) + (1 x 2^2) + (0 x 2^1) + (1 x 2^0).

You can convert an integer decimal number to a binary number by a recurrsive algorithm.

Binary(X)

Simple cases: If X is 0, the binary of X is 0. If X is 1, the binary of X is 1

Complex case: Print the binary of (X / 2). Print the binary of (X % 2). (Note: % means the remainder of a division)

Test your function. The binary of 12 is 1100. The binary of 3 is 11.

Hint: Do NOT use floating point numbers. This algorithm only works with integer numbers.

Reference no: EM131316487

Questions Cloud

Write a gui application that prints out hello in english : Write a GUI application that prints out "Hello!" in either: English, French, or Spanish. When the user selects another language, the greeting shown in the greeting area should change.
What you would recommend as the coo to improve the speed : In a 2- to 3-page Microsoft Word document, describe what you would recommend as the COO to improve the speed with which Amazon.com customers receive the products that they have ordered. What negative consequences or disadvantages, if any, do you s..
Compute the standard estimator of the volatility parameter : Consider the following collection of n=9 closing for stock ABC: 101.02, 102.23, 100.34, 99.87, 98.65, 96.45, 98.45, 99.00, 100.05. Compute the standard estimator of the volatility parameter σ using these closing prices.
Standard estimator of the volatility parameter : Consider the following collection of n = 9 closing prices for stock ABC: Compute the standard estimator of the volatility parameter σ using these closing prices.
Convert an integer decimal number to a binary number : You can convert an integer decimal number to a binary number by a recurrsive algorithm. Binary(X) Simple cases: If X is 0, the binary of X is 0. If X is 1, the binary of X is 1.
Find the displacement of the right bar : Identical springs are connected in series and in parallel (Fig. P4.1). If the stiffness of each spring is k and if the right rigid bar is subjected to a lateral force F, find the displacement of the right bar.
Describe the company supply chain : Create a 14-slide presentation in which you analyze and evaluate the current state of the selected company's supply chain and an identified process. Include the following in the presentation: Describe the company's supply chain. Identify an interna..
What is discount rate must the market : A $100 face value preferred share (with no special features) with a stated 4% dividend is observed trading in the market at $103.24. What is discount rate must the market be using to value this share?
Find the effective stiffness as a function of the spring : When a horizontal bar connecting the springs moves perpendicular to the ceiling, find the effective stiffness as a function of the spring ' s stiffness.

Reviews

Write a Review

Assembly Language Questions & Answers

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

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