Answer:
An interpreter translates one line of code and then executes it before moving to the next line. Think of it like an online language translator.
Answer:
#code (count_seq.py)
def count_seq():
n='2'
while True:
yield int(n)
next_value=''
while len(n)>0:
first=n[0]
count=0
while len(n)>0 and n[0]==first:
count+=1
n=n[1:]
next_value+='{}{}'.format(count,first)
n=next_value
if __name__ == '__main__':
gen=count_seq()
for i in range(10):
print(next(gen))
Explanation:
- Start with number 2. Use string instead of integers for easy manipulation
.
- Loop indefinitely
.
- Yield the integer value of current n
.
- Loop until n is an empty string
.
- Loop as long as n is non empty and first digit of n is same as first
.
- Append count and first digit to next_value
.
Worddesign allows you to add formatting such as shapes and colours to text
Answer:
1. 2588672 bits
2. 4308992 bits
3. The larger the data size of the cache, the larger the area of memory you will need to "search" making the access time and performance slower than the a cache with a smaller data size.
Explanation:
1. Number of bits in the first cache
Using the formula: (2^index bits) * (valid bits + tag bits + (data bits * 2^offset bits))
total bits = 2^15 (1+14+(32*2^1)) = 2588672 bits
2. Number of bits in the Cache with 16 word blocks
Using the formula: (2^index bits) * (valid bits + tag bits + (data bits * 2^offset bits))
total bits = 2^13(1 +13+(32*2^4)) = 4308992 bits
3. Caches are used to help achieve good performance with slow main memories. However, due to architectural limitations of cache, larger data size of cache are not as effective than the smaller data size. A larger cache will have a lower miss rate and a higher delay. The larger the data size of the cache, the larger the area of memory you will need to "search" making the access time and performance slower than the a cache with a smaller data size.
Answer:
add the following code to your bar class
Explanation:
public Bar(Commands n) { }