Answer: See below
Explanation:
<u>Description:</u> In this program, read-option from the user and based on that, perform the operation. And display the balance if the balance is negative.
<u>transactions.py</u>
balance = 1000
#read options from the user
option = input("Deposit or withdrawal: ")
amount = 0
#check if option is a withdrawal
if option == 'withdrawal':
amount = int(input("Enter an amount: "))
balance = balance - amount
#check option is deposit
elif option == 'deposit':
amount = int(input("Enter an amount: "))
balance = balance + amount
else:
print("Invalid transaction.")
#check balance is less than 0 (negative)
if balance < 0:
print("You cannot have a negative balance!")
else:
print("Final balance:",balance)
The distinction between "computer architecture" and "computer organization" has become very fuzzy, if no completely confused or unusable. Computer architecture was essentially a contract with software stating unambiguously what the hardware does. The architecture was essentially a set of statements of the form "If you execute this instruction (or get an interrupt, etc.), then that is what happens. Computer organization, then, was a usually high-level description of the logic, memory, etc, used to implement that contract: These registers, those data paths, this connection to memory, etc.
Programs written to run on a particular computer architecture should always run correctly on that architecture no matter what computer organization (implementation) is used.
For example, both Intel and AMD processors have the same X86 architecture, but how the two companies implement that architecture (their computer organizations) is usually very different. The same programs run correctly on both, because the architecture is the same, but they may run at different speeds, because the organizations are different. Likewise, the many companies implementing MIPS, or ARM, or other processors are providing the same architecture - the same programs run correctly on all of them - but have very different high - level organizations inside them.
Explanation:
Here if the value in the register $f2 is equals to the value in $f4, it jumps to the Label1. If it should jump when the value in the register $f2 is NOT equals to the value in $f4, then it should be