
Concept explainers
MICROPROCESSOR:
Simulate the
a. Program No. 1
1.
LXI H, 6000H :"Initialize pointer l to first number"
2.
LXI D, 6l00H :"Initialize pointer2 to second number"
3.
LXI B,
6200H :"Initialize pointer3 to result"
4.
STC
5.
CMC :"Carry = 0"
6.
BACK: LDAX D :"Get the digit"
7.
ADD M :"Add two digits"
8.
DAA :"Adjust for decimal"
9.
STAX.B :"Store the result"
10.
INX H :"
Increment pointer 1"
11.
INX D :"Increment pointer2"
12.
INX B :"Increment result pointer"
13.
MOV A, L
14.
CPI 06H :"Check for last digit"
15.
JNZ BACK :"If not last digit repeat"
16.
HLT :"Terminate program
execution"
a.
Program No. 2
1.
LXI H, 2200H :"Initialize memory pointer l"
2.
LXI D, 2300H :"Initialize memory pointer2"
3.
MVI C, 32H :"Initialize counter"
4.
BACK:MOV A, M :"Get the number"
5.
ANI 0lH :"Check for even number"
6.
J
NZ SKIP :"If ODD, don't store"
7.
MOV A, M :"Get the number"
8.
STAX D :"Store the number in result list"
9.
INX D :"Increment pointer 2"
10.
SKIP: INX H :"Increment pointer l"
11.
DCR C
:"Decrement counter"
12.
JNZ BACK :"If not zero, repeat"
13.
HLT :"Stop
a.
Program No. 3
2.
LDA 2200H
3.
MOV C, A :"Initialize counter"
4.
LXI H, 2201H :"Initialize pointer"
5.
MVI E, 00 :"Sum low = 0"
6.
MOV D, E :
"Sum high = 0"
7.
BACK: MOV A, M :"Get the number"
8.
ANI 0lH :"Mask Bit 1 to Bit7"
9.
JZ SKIP :"Don't add if number is even"
10.
MOV A, E :"Get the lower byte of sum"
11.
ADD M :"Sum = sum + data"
12.
MOV E, A :"St
ore result in E register"
13.
JNC SKIP
14.
INR D :"Add carry to MSB of SUM"
15.
SKIP: INX H :"Increment pointer"

Step by stepSolved in 3 steps

- Vocabulary Task (C language) Solution given below. How to fix the error in the picture attached. txt file is not being created from this code please also include how to create a txt file and where will it be saved in the computer Natural language processing (NLP) is a field of artificial intelligence that seeks to develop the ability of a computer program to understand human language. Usually, the first step of an NLP system is to convert words into numeric codes. Thus, the system converts an input text into a sequence of numeric codes before any high-level analysis. This process is known as text preprocessing. We can only perform text preprocessing if we have a vocabulary of words and their associated numeric codes. Your task is to create a vocabulary of unique words for a given text file and assign a different number from 1 to N to each unique word, with N being the total number of unique words. You must perform this assignment so that the first word in alphabetical order gets the…arrow_forwardCustomized step counter Learning Objectives In this lab, you will Create a function to match the specifications Use floating-point value division Instructions A pedometer treats walking 2,000 steps as walking 1 mile. It assumes that one step is a bit over 18 inches (1 mile = 36630 inches, so the pedometers assume that one step should be 18.315 inches). Let's customize this calculation to account for the size of our stride. Write a program whose input is the number of steps and the length of the step in inches, and whose output is the miles walked. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print(f'{your_value:.2f}') Ex: If the input is: 5345 18.315 the output is: You walked 5345 steps which are about 2.67 miles. Your program must define and call the following function. The function should return the number of miles walked.def steps_to_miles(user_steps, step_length) # Define your function here if __name__…arrow_forwardPython 6. Sum of Numbers Design a function that accepts an integer argument and returns the sum of all the integers from 1 up to the number passed as an argument. For example, if 50 is passed as an argument, the function will return the sum of 1, 2, 3, 4, ...50. Use recursion to calculate • the sum.arrow_forward
- Python 3 NO IMPORT PICKLE Please check the picture and add one more function(def) and fix the error in the code. Write a program that keeps names and email addresses in a dictionary as key-value pairs. You Must create and use at least 5 meaningful functions. A function to display a menu A function to look up a person’s email address A function to add a new name and email address A function to change an email address A function to delete a name and email address. This is the Required Output example: Menu ---------------------------------------- 1. Look up an email address 2. Add a new name and email address 3. Change an existing email address 4. Delete a name and email address 5. Quit the program Enter your choice: 2 Enter name: John Enter email address: John@yahoo.com That name already exists Menu ---------------------------------------- 1. Look up an email address 2. Add a new name and email address 3. Change an existing email address 4. Delete a name and email address…arrow_forwardData Management Functions - Name format. Python*a) Define a function nameFormat() with parameters first, middle, and last.-This function prints the first name, the middle initial and the last name using proper title format.-Call the function nameFormat with these positional arguments: john stu smith-Call the function nameFormat with these keyword arguments: last=‘kennedy’, first=‘john’, middle=‘fitzgerald’ Example Output John S. SmithJohn F. Kennedyarrow_forwardSegmentation: Select all of the following statements that are true. In segmentation, a logical address always has a length of 32 bit. In order to translate logical into physical addresses, the memory management unit uses the segment part of the logical address to determine the start address in the segment table and adds the offset to this to get the physical address. In segmentation, the logical address consists of a segment part and an offset. The segment length is limited by the maximum possible segment number. When applying segmentation, processes are only allowed to access the memory within their segments. Segments can be assigned access rights and privilege levels.arrow_forward
- The code box below defines a variable route as a list of directions to navigate a maze. Each instruction is one of the following four basic commands: higher move one step in the positive y direction • lower. move one step in the negative y direction • left: move one step in the negative x direction • right: move one step in the positive x direction Define a function step that takes two arguments, a location (as a tuple of x and y coordinates) and an instruction (higher, lower, left, right) as a string. Given the provided location, it should return the new location (as a tuple of x and y coordinates) when following the specified instruction. If the instruction is invalid, the old location should be returned. Use the function step to determine the final position when starting from the point (0, -4) and following all instructions in the list route. Assign this final position to the variable final_point.arrow_forwardDiscuss the following. a. Pointersb. Arraysc. Structuresd. Classese. functionsarrow_forwardPython 3 NO IMPORT PICKLE Please check the picture and add one more function(def) to display menu and fix the error in the code. Write a program that keeps names and email addresses in a dictionary as key-value pairs. You Must create and use at least 5 meaningful functions. A function to display a menu A function to look up a person’s email address A function to add a new name and email address A function to change an email address A function to delete a name and email address. This is the Required Output example: Menu ---------------------------------------- 1. Look up an email address 2. Add a new name and email address 3. Change an existing email address 4. Delete a name and email address 5. Quit the program Enter your choice: 2 Enter name: John Enter email address: John@yahoo.com That name already exists Menu ---------------------------------------- 1. Look up an email address 2. Add a new name and email address 3. Change an existing email address 4. Delete a name and…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





