Skip to main content

                CAMP ASSIGNMENT 4 SOLUTION


66>>Design an 8085 microprocessor based system working at 3 MHz having the

following interface:

1) 8 KB EPROM using 4KB chips

2) 16 KB RAM using 8KB chips




ANS---->

              To design a microprocessor-based system with the given specifications, we will need the following components:

  1. 8085 microprocessor: The heart of the system, it will execute the program stored in the EPROM and access data from RAM.
  2. 8 KB EPROM: To store the program code, we will use four 4KB EPROM chips.
  3. 16 KB RAM: To store data during program execution, we will use two 8KB RAM chips.
  4. Address decoder: To select the appropriate memory chip based on the address signals from the microprocessor.
  5. Clock generator: To provide a clock signal to the microprocessor and other components.

The following is a high-level diagram of the system:

+-----------------------+ | | | 8085 MPU | | | +-----------+-----------+ | | +-------+-------+ | | | Address bus | | | +---------------+ | | +-----------+-----------+ | | | Address | | Decoder | | | +-----------+-----------+ | +----------------+---------------+ | | | | | | +---------+---------+ +---+---+ +--------+--------+ | | | | | | | 4KB EPROM | | | | 8KB RAM | | | | | | | +-------------------+ +-------+ +-----------------+



Here's how the components are connected:

  1. The 8085 microprocessor is connected to the address and data buses.
  2. The address bus is connected to the address decoder.
  3. The address decoder selects the appropriate memory chip based on the address signals from the microprocessor.
  4. The EPROM chips are connected to the data bus through the address decoder.
  5. The RAM chips are also connected to the data bus through the address decoder.
  6. The clock generator provides a clock signal to the microprocessor and other components.

To implement the EPROM and RAM chips, we will need to configure the address decoder to select the appropriate chip based on the address range. For example, we can use the address range 0000H-1FFFH for the EPROM and 2000H-3FFFH for the RAM.

We can also use chip enable signals to enable or disable each memory chip. For example, we can use the chip enable signal of the EPROM to enable or disable the EPROM chips based on the address range. Similarly, we can use the chip enable signal of the RAM to enable or disable the RAM chips based on the address range.

With these components and connections, we can design a microprocessor-based system with 8KB of EPROM and 16KB of RAM that runs at 3MHz.


67>>

A binary number is stored in memory location 2050H. Convert it into BCD

number and store BCD 1 (least significant BCD digit) into memory location

2051H and BCD 2 and BCD 3 in memory locations 2052H and 2053H.

(Binary to BCD conversio


ANS---->To convert a binary number into BCD format, we need to convert each 4-bit nibble of the binary number into its equivalent BCD digit. Here's how we can convert the binary number stored in memory location 2050H into BCD:

  1. Load the binary number from memory location 2050H into a register.
  2. Divide the register by 10 to obtain the least significant BCD digit. Store the remainder in memory location 2051H.
  3. Divide the register by 10 again to obtain the second least significant BCD digit. Store the remainder in memory location 2052H.
  4. Divide the register by 10 once more to obtain the most significant BCD digit. Store the remainder in memory location 2053H.

Here's the assembly code to perform this conversion:

; Load binary number from memory location 2050H into register A LDA 2050H MOV B, A ; Copy binary number to register B ; Divide by 10 to obtain least significant BCD digit MOV A, B ANI 0FH ; Clear upper nibble MOV C, A MOV A, B SUB C ; Divide by 10 MOV C, A MOV A, C ; Save least significant BCD digit to memory STA 2051H ; Divide by 10 to obtain second least significant BCD digit MOV A, B ANI 0FH ; Clear upper nibble MOV C, A MOV A, B SUB C ; Divide by 10 MOV C, A MOV A, C ; Save second least significant BCD digit to memory STA 2052H ; Divide by 10 to obtain most significant BCD digit MOV A, B ANI 0FH ; Clear upper nibble MOV C, A MOV A, B SUB C ; Divide by 10 MOV C, A MOV A, C ; Save most significant BCD digit to memory STA 2053H



After executing this code, the BCD equivalent of the binary number stored in memory location


68>>

An 8-bit number is stored in memory location 2050H. Write a program to

convert the number into ASCII Hexcode and save the result in memory

locations 2060H and 2061H

(Binary to ASCII conversion)


ANS---->To convert an 8-bit binary number into ASCII Hexcode, we need to convert each 4-bit nibble of the binary number into its equivalent ASCII character. Here's how we can convert the binary number stored in memory location 2050H into ASCII Hexcode:

  1. Load the binary number from memory location 2050H into a register.
  2. Mask the upper nibble of the register to get the value of the lower nibble.
  3. Convert the lower nibble to its ASCII Hexcode equivalent and store it in memory location 2060H.
  4. Shift the register right by 4 bits to get the value of the upper nibble.
  5. Convert the upper nibble to its ASCII Hexcode equivalent and store it in memory location 2061H.

Here's the assembly code to perform this conversion:

After executing this code, the ASCII Hexcode equivalent of the binary number stored in memory location 2050H will be stored in memory locations 2060H and 2061H. For example, if the binary number stored in memory location 2050H is 10101010, the ASCII Hexcode equivalent "AA" will be stored in memory locations 2060H and 2061H.

; Load binary number from memory location 2050H into register A LDA 2050H ; Convert lower nibble to ASCII Hexcode and store in memory location 2060H MOV B, A ANI 0FH ; Mask upper nibble CALL bin2hex STA 2060H ; Shift right by 4 bits to get upper nibble MOV A, B DAA ; Adjust for decimal arithmetic RRC ; Shift right by 4 bits ; Convert upper nibble to ASCII Hexcode and store in memory location 2061H CALL bin2hex STA 2061H HLT bin2hex: ; Convert binary digit in A to ASCII Hexcode and return result in A PUSH PSW ANI 0FH ADDI 30H JNC skip ADDI 07H skip: POP PSW RET



69>>

Write a program in ALP of 8085 to convert a 2-digit BCD number stored at

memory location 2050H into binary equivalent number and store the result

in memory location 2060H.

(BCD to Binary conversion)

ANS---->To convert a 2-digit BCD number stored in memory location 2050H into its binary equivalent and store the result in memory location 2060H, we can use the following algorithm:

  1. Load the BCD number from memory location 2050H into a register.
  2. Clear the high-order byte of the register.
  3. Convert the low-order BCD digit to its binary equivalent by masking the lower nibble and adding it to the register.
  4. Shift the register left by 4 bits.
  5. Convert the high-order BCD digit to its binary equivalent by masking the lower nibble and adding it to the register.
  6. Store the resulting binary number in memory location 2060H.

Here's the assembly code to perform this conversion:


LDA 2050H ; Load the BCD number from memory location 2050H MOV B, A ; Move the BCD number to register B ANI 0FH ; Mask the low-order BCD digit MOV A, B ; Move the BCD number back to register A ADD B ; Add the low-order binary digit to the register XCHG ; Swap the contents of the registers ANI 0FH ; Mask the high-order BCD digit MOV C, A ; Move the result to register C MOV A, B ADD C ; Add the high-order binary digit to the register MOV C, A ; Move the result back to register C SHLD 2060H ; Store the binary number in memory location 2060H HLT ; End of program


After executing this code, the binary equivalent of the 2-digit BCD number stored in memory location 2050H will be stored in memory location 2060H.


Comments

Popular posts from this blog

Question bank solution of CAMP

     1>> Explain basic computer organization and enlist various design components. ANS----> .   Computer organization refers to the way in which a computer's various components work together to execute instructions and perform tasks. The basic computer organization includes various design components, which are as follows: Central Processing Unit (CPU): It is the brain of the computer that performs all the arithmetic and logical operations. The CPU consists of an arithmetic logic unit (ALU) that performs arithmetic and logical operations, a control unit (CU) that fetches instructions from memory and decodes them, and registers that store data. Memory Unit: It is the component of the computer that stores instructions and data. The memory unit consists of two types of memory: primary memory and secondary memory. Primary memory, also known as main memory, includes Random Access Memory (RAM) and Read-Only Memory (ROM), while secondary memory

PYTHON ASSIGNMENT 5 AND 6 SOLVED

  PYTHON  ASSIGNMENT – 5 1>What is string concatenation? Explain different ways to concatenate strings. ANS>> String concatenation is the process of combining two or more strings into a single string. In programming, it is a commonly used operation for manipulating text data. There are different ways to concatenate strings depending on the programming language or framework being used. Here are some examples: Using the plus (+) operator: In many programming languages, the simplest way to concatenate strings is by using the plus (+) operator. This is also known as the concatenation operator. Here's an example in Python: string1 = "Hello" string2 = "World" result = string1 + " " + string2 print(result) OUTPUT: Hello World 2.Using the join() method: Another way to concatenate strings is by using the join() method. This method takes an iterable (such as a list or tuple) of strings as an argument and concatenates them with a separator string. Here&#
  PYTHON PROGRAMMING QUESTION BANK SOLUTION:                               UNIT: 1 1>> Explain features of python. ANS---->.   Python is a popular high-level programming language that is known for its simplicity, readability, and versatility. Some of the key features of Python are: Easy to Learn: Python has a clean and simple syntax that is easy to understand and learn, even for beginners. Interpreted Language: Python code is executed line by line by the interpreter, which means that you don't have to compile your code before running it. Cross-platform: Python is a portable language that can be used on a variety of operating systems, including Windows, Linux, and Mac OS. Object-Oriented Programming (OOP) support: Python supports object-oriented programming, which allows developers to write reusable and modular code. Large Standard Library: Python has a large and comprehensive standard library, which includes modules for many common tasks such as file I/O, regular expressio