- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Design a Moore machine to generate 1's complement of a binary number.

Moore machine has 6 tuples, which are as follows −

**(Q, q0, Σ, O, δ, λ)**

Where,

- Q: Finite set of states
- q0: Initial state of machine
- Σ: Finite set of input symbols
- O: Output alphabet
- δ: Transition function where Q × Σ → Q
- λ: Output function where Q → O

The transition diagram is as follows −

## Explanation

**Step 1**− q0 is the start state on input ‘0’ goes to q1 state and on ‘1’ goes to state q2 generating output 0.**Step 2**− q1 on input ‘0’ goes to q1 itself and on ‘1’ goes to q2 generating output ‘1’.**Step 3**− q2 on input ‘0’ goes to q1 and on ‘1’ goes to q2 generating output ‘0’.

**For instance,**

Take one binary number: **1011**.

Input

Input | 1 | 0 | 1 | 1 | |
---|---|---|---|---|---|

State | q0 | q2 | q1 | q2 | q2 |

Output | 0 | 0 | 1 | 0 | 0 |

Let’s construct the transition table for the given language. The table is as follows −

Current State | Next State | Output | |
---|---|---|---|

0 | 0 | ||

->q0 | q1 | q2 | 0 |

q1 | q1 | q2 | 1 |

q2 | q1 | q2 | 0 |

- Related Questions & Answers
- Draw a Turing machine to find 1’s complement of a binary number
- Design a Moore machine for some binary input sequence.
- 1’s and 2’s complement of a Binary Number?
- Draw a Turing machine to find 2’s complement of a binary number
- 1's Complement vs 2's Complement
- Design a TM that increments a binary number by 1
- 1's complement notation
- Design a DFA machine accepting odd numbers of 0’s or even numbers of 1’s
- 10’s Complement of a decimal number?
- What is a Moore Machine in TOC?
- Previous number same as 1’s complement in C++
- Design Turing Machine to reverse string consisting of a’s and b’s
- 8085 program to find 1's and 2's complement of 8-bit number
- 8085 program to find 1's and 2's complement of 16-bit number
- Differentiate between Mealy machine and Moore machine in TOC

Advertisements