<h2>Solution :</h2>
The given problem is solved in Python.
def ComputeSquare():
side = float(input('Enter the side of the square: '))
if side > 0:
perimeter = 4 * side
area = side * side
print('Perimeter of the square is:',
perimeter, 'unit.')
print('Area of the square is:', area, 'square unit.')
<h3> else:</h3>
print('Invalid input.')
ComputeSquare()
<h2>Explanation :-</h2>
- In this program, we create a function ComputeSquare() to calculate the perimeter and area of a square.
- The function asks the user to enter the side of the square. The side is then stored in a variable.
- Now, we check whether the side is greater than 0 or not using if-else statement.
- If the condition is true, the perimeter and area is calculated which is displayed using print() statement.
- If the condition is false, the else blocks executes printing the error message.
<h3>Refer to the attachment for output.</h3>
Answer:
Required memory size is 16k x 8
16k = 24 x 210 = 214
Hence, No. of address lines = 14
No. of data lines = 8
a) Size of IC 1024 x 1
Total number of ICs required = 16k x 8 / 1024 x 1 = 16 x 8 = 128
b) Size of IC 2k x 4
Total number of ICs required = 16k x 8 / 2k x 4 = 8 x 2 = 16
c) Size of IC 1k x 8
Total number of ICs required = 16k x 8 / 1k x 8 = 16 x 1 = 16
Explanation:
For a, 10 address lines from A0 to A9 are used to select any one of the memory location out of 1024 memory locations present in a IC.
For b, 11 address lines from A0 to A10 are used to select any one of the memory location out of 2k=2048 memory locations present in a IC.
For c, 10 address lines from A0 to A9 are used to select any one of the memory location out of 1k=1024 memory locations present in a IC.
D iTunes hope this helps!
More people adopt the technology during any period, leading to an increasing rate of adoption. So, yes