1 Recap lecture 21 Example of Moore machine, Mealy machine, Examples, complementing machine, Incrementing machine.

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Advertisements

Finite Automata with Output
Lecture # 14 Theory Of Automata By Dr. MM Alam 1.
Chapter 2 : Number System
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Parallel Adder Recap To add two n-bit numbers together, n full-adders should be cascaded. Each full-adder represents a column in the long addition. The.
ECE 331 – Digital System Design
ECE 331 – Digital System Design
Conformance Simulation Relation ( ) Let and be two automata over the same alphabet simulates () if there exists a simulation relation such that Note that.
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
1 Binary Arithmetic, Subtraction The rules for binary arithmetic are: = 0, carry = = 1, carry = = 1, carry = = 0, carry =
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
1.6 Signed Binary Numbers.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Unit 14 Derivation of State Graphs
CSC312 Automata Theory Lecture # 19 Chapter # 8 by Cohen Finite Automata with Output.
Java Software Solutions Lewis and Loftus Chapter 5 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. More Programming Constructs.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Moore machine and Mealy machine (P.274)
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Lecture # 15 Theory Of Automata By Dr. MM Alam 1.
Introduction to State Machine
1 Recap lecture 22 Applications of complementing and incrementing machines, Equivalent machines, Moore equivalent to Mealy, proof, example, Mealy equivalent.
Sep 29, 2004Subtraction (lvk)1 Negative Numbers and Subtraction The adders we designed can add only non-negative numbers – If we can represent negative.
ECE 301 – Digital Electronics Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included.
1 Recap lecture 27 Pumping lemma version II, proof, examples, Myhill Nerode theorem, examples.
Introduction to Microprocessors Chapter 2. Decimal or Base 10 Numbers  Have ten different digits (0-9)  It is a weighted number system. Each position.
SAK Chapter 21 Chapter 2 : Number System 2.1 Decimal, Binary, Octal and Hexadecimal Numbers 2.2 Relation between binary number system with other.
Lecture # 12. Nondeterministic Finite Automaton (NFA) Definition: An NFA is a TG with a unique start state and a property of having single letter as label.
Lecture 8 Theory of AUTOMATA
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
Introduction * Binary numbers are represented with a separate sign bit along with the magnitude. * For example, in an 8-bit binary number, the MSB is.
Lecture # 15. Mealy machine A Mealy machine consists of the following 1. A finite set of states q 0, q 1, q 2, … where q 0 is the initial state. 2. An.
Numerical formats What’s the main idea? Want to represent numbers (eg: 45, -12, ) using only bits. We’ve already seen (or you can read in the book)
CPS120: Introduction to Computer Science Computer Math: Addition and Subtraction.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
Materials on the Exam Introduction Data Representation in Computer Systems Boolean Algebra Digital Logic MARIE: An Introduction to a Simple Computer Until.
1 Recap lecture 28 Examples of Myhill Nerode theorem, Quotient of a language, examples, Pseudo theorem: Quotient of a language is regular, prefixes of.
Lecture 06: Theory of Automata:08 Finite Automata with Output.
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
Lecture 14: Theory of Automata:2014 Finite Automata with Output.
Mealy and Moore Machines Lecture 8 Overview Moore Machines Mealy Machines Sequential Circuits.
1 Advanced Theory of Computation Finite Automata with output Pumping Lemma Theorem.
Finite Automata (FA) with Output FA discussed so far, is just associated with R.Es or language. Is there exist an FA which generates an output string corresponding.
Lecture # 16. Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are.
Lecture 4: Digital Systems & Binary Numbers (4)
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
Negative Number Sign-Magnitude: left-most bit as the sign bit –16 bits –Example: 4-bit numbers is given by is given by ’s complement:
Negative Numbers and Subtraction
Number Systems.
Addition and Substraction
Jaya Krishna, M.Tech, Assistant Professor
King Fahd University of Petroleum and Minerals
Subtraction The arithmetic we did so far was limited to unsigned (positive) integers. Today we’ll consider negative numbers and subtraction. The main problem.
Kleene’s Theorem Muhammad Arif 12/6/2018.
EEL 3705 / 3705L Digital Logic Design
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
Recap Lecture 16 Examples of Kleene’s theorem part III (method 3), NFA, examples, avoiding loop using NFA, example, converting FA to NFA, examples, applying.
ReCap Chomsky Normal Form, Theorem regarding CNF, examples of converting CFG to be in CNF, Example of an FA corresponding to Regular CFG, Left most and.
ECE 331 – Digital System Design
ECE 352 Digital System Fundamentals
Recap Lecture 17 converting NFA to FA (method 3), example, NFA and Kleene’s theorem method 1, examples, NFA and Kleene’s theorem method 2 , NFA corresponding.
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
Recap lecture 23 Mealy machines in terms of sequential circuit.
Recap Lecture 15 Examples of Kleene’s theorem part III (method 3), NFA, examples, avoiding loop using NFA, example, converting FA to NFA, examples, applying.
Recap lecture 20 Recap Theorem, Example, Finite Automaton with output, Moore machine, Examples.
Finite Automaton with output
Mealy and Moore Machines
Today Binary addition Representing negative numbers 2.
Presentation transcript:

1 Recap lecture 21 Example of Moore machine, Mealy machine, Examples, complementing machine, Incrementing machine.

2 Solution of the Task Incrementing machine with two states 0/1 q1q1 q0q0 1/0 0/0, 1/1

3 Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are very much helpful in computing. The incrementing machine helps in building a machine that can perform the addition of binary numbers. Using the complementing machine along with incrementing machine, one can build a machine that can perform the subtraction of binary numbers, as shown in the following method

4 Subtracting a binary number from another Method: To subtract a binary b from a binary number a 1.Add 1’s complement of b to a (ignoring the overflow, if any) 2.Increase the result, in magnitude, by 1 (use the incrementing machine ). Ignoring the overflow if any. Note: If there is no overflow in (1). Take 1’s complement once again in (2), instead. This situation occurs when b is greater than a, in magnitude. Following is an example of subtraction of binary numbers

5 Example To subtract the binary number 101 from the binary number 1110, let a = 1110 and b = 101 = (Here the number of digits of b are equated with that of a) i)Adding 1’s complement (1010) of b to a which gives 1000 ( ignoring the overflow)

6 Example continued … ii)Using the incrementing machine, increase the above result 1000, in magnitude, by which is the same as obtained by ordinary subtraction.

7 Note It may be noted that the above method of subtraction of binary numbers may be applied to subtraction of decimal numbers with the change that 9’s complement of b will be added to a, instead in step (1). Following is the task in this regard

8 Task Subtract 39 from 64 Solution:Taking a=64 and b=39. i)Adding 9’s complement (60) of b to a which gives 24 ( ignoring the overflow) ii)Increasing the above result 24, in magnitude, by which is the same as obtained by ordinary subtraction.

9 Equivalent machines Two machines are said to be equivalent if they print the same output string when the same input string is run on them. Remark: Two Moore machines may be equivalent. Similarly two Mealy machines may also be equivalent, but a Moore machine can’t be equivalent to any Mealy machine. However, ignoring the extra character printed by the Moore machine, there exists a Mealy machine which is equivalent to the Moore machine.

10 Theorem Statement: For every Moore machine there is a Mealy machine that is equivalent to it (ignoring the extra character printed by the Moore machine). Proof: Let M be a Moore machine, then shifting the output characters corresponding to each state to the labels of corresponding incoming transitions, machine thus obtained will be a Mealy machine equivalent to M. Following is a note

11 Note It may be noted that while converting a Moore machine into an equivalent Mealy machine, the output character of a state will be ignored if there is no incoming transition at that state. A loop at a state is also supposed to be an incoming transition. Following is the example of converting a Moore machine into an equivalent Mealy machine

12 Example Consider the following Moore machine Using the method described earlier, the above machine may be equivalent to the following Mealy machine b a q 0 /0 a b q 1 /1 q 2 /0 q 3 /1 a,b a b

13 Example continued... b/0 a/1 q0q0 b /1 q1q1 q2q2 q3q3 a /1,b /1 a /0 b /0 Running the string abbabbba on both the machines, the output string can be determined by the following table

14 Example continued Moore q3q3 q3q3 q3q3 q3q3 q3q3 q3q3 q2q2 q1q1 q0q0 States abbbabbaInput Mealy

15 Theorem Statement: For every Mealy machine there is a Moore machine that is equivalent to it (ignoring the extra character printed the Moore machine). Proof: Let M be a Mealy machine. At each state there are two possibilities for incoming transitions 1.The incoming transitions have the same output character. 2.The incoming transitions have different output characters.

16 Proof continued … If all the transitions have same output characters, then shift that character to the corresponding state. If all the transitions have different output characters, then the state will be converted to as many states as the number of different output characters for these transitions, which shows that if this happens at state q i then q i will be converted to q i 1 and q i 2 i.e. if at q i there are the transitions with two output characters then q i 1 for one character and q i 2 for other character.

17 Proof continued … Shift the output characters of the transitions to the corresponding new states q i 1 and q i 2. Moreover, these new states q i 1 and q i 2 should behave like q i as well. Continuing the process, the machine thus obtained, will be a Moore machine equivalent to Mealy machine M. Following is a note

18 Note It may be noted that if there is no incoming transition at certain state then any of the output characters may be associated with that state. It may also be noted that if the initial state is converted into more than one new states then only one of these new states will be considered to be the initial state. Following is an example

19 Example Consider the following Mealy machine a/0 b/1 a/1 q1q1 a/0 q2q2 q0q0 q3q3 a/1 b/0 b/1

20 Example continued... a/0 b a/1 q1q1 a/0 q2q2 q 0 /1 q3q3 a/1 b/0 b/1 Shifting the output character 1 of transition b to q 0

21 Example continued... a b a/1 q 1 /0 a/0 q2q2 q 0 /1 q3q3 a/1 b/0 b/1 Shifting the output character 0 of transition a to q 1

22 Example continued... a b a/1 q 1 /0 a/0 q 2 /1 q 0 /1 q3q3 a/1 b/0 b/1 b Shifting the output character 1 of transition b to q 2

23 Example continued... a q 1 /0 q 2 /1 q 0 /1 q 3 /0 b q 3 /1 a a b b b b a 1 2 a Splitting q 3 into q 3 and q 3 12

24 Example continued … Running the string abbabbba on both the machines, the output strings can be determined by the following table Mealy q1q1 q0q0 q3q3 q0q0 q3q3 q3q3 q2q2 q1q1 q0q0 States abbbabbaInput Moore

25 Summing Up Applications of complementing and incrementing machines, Equivalent machines, Moore equivalent to Mealy, proof, example, Mealy equivalent to Moore, proof, example