Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[3] [40 pts] Convert a four-bit binary number to decimal. (40 pts - 20 pts for flowchart, 20 for code) Draw a flowchart and write
[3] [40 pts] Convert a four-bit binary number to decimal. (40 pts - 20 pts for flowchart, 20 for code) Draw a flowchart and write an LC-3 assembly language program that reads a four-bit unsigned binary number from the user, and prints the equivalent decimal number on the next line. The user types four bits or 0), followed by linefeed. Assume that the user will type exactly four characters before the linefeed, and that only 1' and '0' will be typed. Accumulate the bits into a register as they are typed. One good way to do that is: (1) Start with a value of zero. (2) When a new bit is typed, shift the value to the left and add 1 or 0 to the least significant bit. The result will be a value between 0 and 15, inclusive. Print the characters that represent the . decimal number. The one-digit numbers are easy (based on the first problem). Think about hovw to deal with 10-15
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started