Writing a Mealy model for the 2's complement of subtracting 1101?

In summary, the conversation discusses the creation of a Mealy finite state machine that produces the 2's complement result of subtracting 1101 from a binary input stream. The process involves subtracting 1101 from the input and then converting it to a 2's complement number using a Mealy model. The conversation also explores ways to visualize and break down the process into smaller steps. The goal is to create a Mealy machine for !(input - 1101) + 1. There is a discussion about the direction in which the input string is accepted, whether from left to right or right to left.
  • #1
Lolligirl
23
0
This question is worded in a confusing way:

Question: Write a Mealy finite state machine that produces the 2’s complement result of subtracting 1101 from a binary input stream (assuming at least 4 bits of input).

So our input here is e.g. 10010101 or 001011 or something similar, and we want to first subtract 1101 from the input and then convert it to a 2's complement number using a Mealy model? So if we get 10010101, we'd first subtract 1101 and get 10011000, and then it becomes 01101000? This has a whole lot of numbers changing at once...is there a way to break it down and visualize it that way to convert it to a Mealy model in smaller steps?

I'm starting to see a pattern...we only care about the first 1 (the least significant bit), and from then on, we switch the numbers so that if we get a 0, we make it into a 1, and vice-versa. I know this is terribly incomplete, but I'm trying to figure it out from here:
image.jpg


Basically, how do we continue this to make a Mealy machine for !(input - 1101) + 1?
 
Last edited:
Technology news on Phys.org
  • #2
Dear from which side you are accepting your string ... i mean from left to right or from right to left ?
 

Related to Writing a Mealy model for the 2's complement of subtracting 1101?

1. How do I write a Mealy model for the 2's complement of subtracting 1101?

To write a Mealy model for the 2's complement of subtracting 1101, you must first understand the concept of 2's complement and the subtraction process in binary. Then, you can use a state diagram to design the Mealy model, with each state representing a step in the subtraction process. The output of the model will depend on the current state and the input, which would be the binary representation of 1101.

2. What is the purpose of using a Mealy model for this process?

A Mealy model is used to describe the behavior of a sequential circuit, in this case, the subtraction process. It helps to visualize and understand the steps involved in subtracting 1101 in 2's complement form, and also allows for simulation and verification of the circuit before implementation.

3. How do I determine the states for the Mealy model?

The states for the Mealy model can be determined by breaking down the subtraction process into smaller steps. Each state should represent a unique combination of inputs and outputs, and the transitions between states should correspond to the steps in the subtraction process.

4. What are the inputs and outputs for the Mealy model?

The inputs for the Mealy model would be the binary representation of 1101, which would be four bits (1, 1, 0, 1). The outputs would depend on the current state of the model and the input, and would also be four bits representing the result of the subtraction process.

5. How do I test and verify the Mealy model for correctness?

To test and verify the Mealy model, you can use simulation tools to provide different inputs and observe the outputs at each state. You can also compare the outputs of the model with manual calculations to ensure that the model is functioning correctly. Additionally, you can use formal verification techniques to prove the correctness of the model mathematically.

Similar threads

Replies
5
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
647
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
17
Views
5K
  • Programming and Computer Science
Replies
17
Views
1K
  • Computing and Technology
Replies
4
Views
1K
Back
Top