Write and test a Python script that, given a number of bytes, outputs the equivalent number of kilobytes, megabytes, gigabytes, and terabytes. Write and test a complementary script that, given a number of terabytes, outputs the equivalent number of GB, MB, KB, and bytes.
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Management Information Systems: Managing The Digital Firm (16th Edition)
Starting Out with Python (4th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- Part 1 A small computer on a smart card has four page frames. At the first clock tick, the R bits are 0111 (page 0 is 0, the rest are 1). At subsequent clock ticks, the values are 1011, 1010, 1101, 0010, 1010, 1100, and 0001. If the aging algorithm is used with an 8-bit counter, give the values of the four page counters after the last tick. Part 2 A computer has four page frames. The time of loading, time of last access, and the R and M bits for each page are as shown below (the times are in clock ticks): Page Loaded Last Referenced R M 0 176 330 1 0 1 280 315 0 1 2 190 320 0 0 3 160 335 1 1 (a) Which page will NRU replace? (b) Which page will FIFO replace? (c) Which page will LRU replace? (d) Which page will second chance replace?arrow_forwardConsider two possible floating point storage formats: Format 1 Format 2 • 16 bits total 32 bits total 1 bit for the number sign 1 bit for the number sign o 7 bits for the signed 23 bits for the signed exponent exponent O 8 bits for the mantissa O 8 bits for the mantissa Which format has the smaller maximum relative round-off error for a single calculation? • Format 2 It is impossible to tell Format 1 They are the samearrow_forwardFor a 512k x 32-bit memory system, what is the capacity in bytes? Give the exact number. Remember that 512k is shorthand for 524,288. 16,777,216 16,384,000 2,048,000 2,097,152arrow_forward
- For a computer system using a 64 bit width data path, how many number of a bits will this computer process if it will undergo a combination of 14 Tydbits, 26 Playtes, 13 Bytes and 3 Words,arrow_forwardAssume a 2^20 byte memory (2^20 x 8):A. What are the lowest and highest addresses if memory is byte-addressable?B. What are the lowest and highest addresses if memory is word-addressable, assuming a16-bit word?C. What are the lowest and highest addresses if memory is word-addressable, assuming a32-bit word?arrow_forwardConsider a 32-bit hexadecimal number stored in memory as follows: Address Value 100 2A 101 C2 102 08 103 1B If the machine is little endian and the number is an IEEE single-precision floating-point value, determine the decimal equivalent of the number stored at address 100 (you may leave your answer in scientific notation form, as a number times a power of two).arrow_forward
- By assuming that X is the last digit of your student number and 3X is a two digit number, consider memory storage of a 64-bit word stored at memory word 3X in a byte-addressable memory (a) What is the byte address of memory word 3X? (b) What are the byte addresses that memory word 3X spans? (c) Draw the number 0XF1234567890ABCDE stored at word 3X in both big-endian and little-endian machines. Clearly label the byte address corresponding to each data byte value.arrow_forwardSuppose we have two machines with two page sizes: one using 4KB pages, one using 4MB pages. Give two reasons why 4KB page size might be better than 4MB page sizes, and give one reason why 4MB page size might be better.arrow_forwardConsider a 32-bit number stored in a byte-addressable memory as shown in the table below (note that the value is written in hex format): a. If the machine is little endian and uses 2's complement representation for integers, give the decimal representation of the 32-bit integer that starts at address 100. b. If the machine is big endian and the number is an IEEE single precision floating point value, give the decimal equivalent. Note the following: • When converting the binary significand to its base 10 equivalent, you only need to use the first 8 bits (not all 23) The final answer should be written as a simple real number (i.e., not in exponential format), with the fractional component rounded to 2 decimal places (e.g., 126.46 or -9768.83) Value Address 100 101 102 103 40 92 9C FBarrow_forward
- Don't copyarrow_forwardA 16-bit memory location contains the bit pattern 3A4 written in hexadecimal. What is the equivalent decimal quantity if the memory contents is a 16-bit half-precision floating point quantity? Select one: O a. +0.28125 O b. -0.28125 O c. +25600.O O d. +0.78125 De. +7.8125 D f. No choice is correctarrow_forwardconsider you are looking at a virtual memory of size 1 GiB also a physical memory of size 128 KiB and a page size equal to 8 KiB. FIgure out how many bits are used to specify a virtual page number?arrow_forward
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr