0
\$\begingroup\$

If a system has RAM containing 16K bytes with each of them needing their own distinct address and on top of that it has 16 peripherals and they each require 2^4 distinct addresses, then how many total addresses are required for this system? Based on what I know about memory, I think it's 2^16k + 16*2^4 however I'm not sure how to translate bytes to bits. I know that if a system has 15 bits then it requires 2^18 distinct addresses but what about bytes?

\$\endgroup\$
1
\$\begingroup\$

The total number of addresses in use in the system described would be 16384+16*2^4 for a total of 16640 addresses. In order to address 16640 addresses, you need an address bus with at least 15 address lines, which could address a maximum of 32768 addresses, so 16128 addresses would be unused. This is assuming that your RAM is organized in 8 bit words and is read 8 bits at a time. If for instance, the RAM is organized as 16 bit words, then each address would access two bytes of RAM, then you would need (16k/2)= 8192+16*2^4 or 8448 addresses. Each peripheral still takes one address, but since each address of RAM is now 16 bits wide, you only need half as many addresses for the RAM, but you need 16 data bus lines. If your RAM is organized as 32 bit words, then you need 4096+16*2^4 or 4352 addresses, if for 64 bit words, 2048+16*2^4 or 2304 addresses.

\$\endgroup\$
  • \$\begingroup\$ Alright, now what if the peripherals were mapped separately using a separate I/O bus. If that was the case then what should be the I/O address bus width and the memory bus width? \$\endgroup\$ – Josh Susa Oct 12 '15 at 17:31
0
\$\begingroup\$

In a system each byte is addressed individually. There are 1024 bytes in one k byte. A 16k ram would therefore need 1024*16 = 16384 addresses. Add to that 16*2^4 for the peripherals and you get 16640. You then require at least 15 bits to represent those addresses.

\$\endgroup\$
  • \$\begingroup\$ Where is the 15 bits coming from. If I have a general address represented in bytes then how many bits do I need to represent it. I was thinking if it was 150 bytes then would it be something between 2^7 and 2^8 making it 8 bits? \$\endgroup\$ – Josh Susa Oct 12 '15 at 17:44
  • \$\begingroup\$ If the above assumption is right then how many bits would you use if the memory is word addressable (assuming the word is 24 bytes). \$\endgroup\$ – Josh Susa Oct 12 '15 at 17:47
  • \$\begingroup\$ @JoshSusa if you have 16640 addresses then you need 2^15 to address them. 2^14 would be too small. \$\endgroup\$ – vini_i Oct 12 '15 at 18:16
  • \$\begingroup\$ And what would it be if the memory is word addressable (the word being 24 bytes). \$\endgroup\$ – Josh Susa Oct 12 '15 at 23:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.