Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

b ) A digital system is to count the number of bits in a register, A , that has the value 1 . A step

b) A digital system is to count the number of bits in a register, A, that has the value 1. A step-by-
step procedure, or algorithm, that can be used to perform the required task is as follows:
It assumes that A is stored in a register that can
shift its contents in the left-to-right direction.
The answer produced by the algorithm is
stored in the variable named B. The algorithm
terminates when A does not contain any more
1s, that is when A=0. In each iteration, if the
least-significant bit (LSB) of A is 1, then B is
incremented by 1 ; otherwise, B is not changed.
The contents of A are shifted one bit to the right
at the end of each iteration.
Fig. 3(b) gives an ASM chart that represents
the algorithm. The state box for the starting
state, S1, specifies that B is initialized to 0. It
assumes that an input signal, s, exists, which is used to indicate when the data to be processed
has been loaded into A, so that the machine can start. The decision box labeled 's' stipulates
that the machine remains in state SI as long as s=0. The conditional output box with Load A
written inside it indicates that A is loaded from external data inputs if s=0 in state S1.
When s becomes 1, the machine changes to state S2. The decision box below the state box for
S2 checks whether A=0. If so, the bit-counting operation is complete; hence the machine
should change to state S3. If not, the FSM remains in state S2. The decision box at the bottom
of the chart checks the value of a0. If a0=1,B is incremented, which is indicated in the chart
as BlarrB+1. If a0=0, then B is not changed. In state S3,B contains the result, which is the
number of bits in A that were 1. An output signal, Done, is set to 1 to indicate that the algorithm
is finished; the FSM stays in S3 until s goes back to 0.
i. Design the Datapath circuit of the ASM chart.
ii. Give the ASM chart for the control circuit corresponding to part (i).help
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions

Question

On which port does FTP run by default?

Answered: 1 week ago