a. In many computer languages, any decimal number N must be presented in one of the

Chapter 9, Problem 30

(choose chapter or problem)

a. In many computer languages, any decimal number N must be presented in one of the following forms: sd* sd*.d* d* d*.d* (1) where s denotes the sign (s [ 5+, 6), d is a digit (d [ 50, 1, 2, , 96), and d* denotes a string of digits where the string may be of any length, including length zero (the empty string). Thus, the following would be examples of valid decimal numbers: +2.74 .58 129 + Design a finite-state machine that recognizes valid decimal numbers by producing an output of 1. The input symbols are +, , . , and the 10 digits. To simplify notation, you may use d to denote any digit input symbol. b. Modify the machine of part (a) to recognize any sequence of decimal numbers as defined in part (a) separated by commas. For example, such a machine would recognize +2.74,.58,129,+ The input alphabet should be the same as for the machine of part (a) with the addition of the symbol c for comma. c. Suppose a decimal number must be presented in a form similar to that for part (a) except that any decimal point that appears must have at least one digit before it and after it. Write an expression similar to expression (1) in part (a) to describe the valid form for a decimal number. How would you modify the machine of part (a) to recognize such a number?

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back