Question Details

For a direct-mapped cache, 4 bits are used for the tag field and 12 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block. Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?

Options

A

64 KB and 4 KB

B

128 KB and 16 KB

C

64 KB and 8 KB

D

128 KB and 6 KB

Show Answer
Correct Answer
A 64 KB and 4 KB

Solution :

The correct option is 64 KB and 4 KB.

Let us understand the step-by-step breakdown of how to find the sizes of the main memory and the cache memory in this system.

1. Understanding the Address Format
In a direct-mapped cache, a main memory address is typically divided into three fields:
• Tag field
• Index (or Line/Block offset) field
• Block offset (or Byte offset) field

First, let's look at the given parameters:
• Tag field bits = 4 bits
• Index field bits = 12 bits
• Block size = 1 byte

Since the cache block size is 1 byte, and the system is byte-addressable, we only need 0 bits to identify a byte within a cache block because 20 = 1. Therefore, the block offset field is 0 bits.

2. Determining Main Memory Size
The total number of address bits required for the main memory is the sum of the bits in the tag, index, and block offset fields:

Total Address Bits=Tag bits+Index bits+Block offset bits

Total Address Bits=4+12+0=16 bits

With 16 bits of address space, the total number of addressable locations in the main memory is:
216 bytes

Since 210 bytes = 1 KB:
216 bytes=26×210 bytes=64 KB

Thus, the main memory size is 64 KB.

3. Determining Cache Memory Size
The number of cache lines (or cache blocks) is determined by the number of index bits:
Number of Cache Blocks=2Index bits=212=4096 blocks

The cache memory size (data capacity) is the product of the number of cache blocks and the size of each block:
Cache Size=Number of Blocks×Block Size

Cache Size=4096×1 byte=4096 bytes

Converting this to kilobytes:
4096 bytes=40961024 KB=4 KB

Thus, the cache memory size is 4 KB.

Conclusion
The main memory size is 64 KB and the cache memory size is 4 KB.

Transparent Access on Mindyard

Built for Learners & Educators Alike

Completely free for students. Educators & coaching institutes get 2 months free Pro trial to create tests.

FREE FOR STUDENTS

Practice & Learn Free for Students

Access unlimited practice questions, detailed step-by-step solutions, and exam study materials — completely free for students.

  • Unlimited mock tests & question bank practice
  • Full access to curated study library & formula notes
  • 100% free for students • No credit card required
2 MONTHS FREE TRIAL

Educators & Coaching Institutes

Create and conduct professional online assessments with AI question generation, tab proctoring, and comprehensive batch management.

  • AI question uploader & rapid test generator
  • Anti-cheating tab proctoring & performance reports
  • Full Pro access free for 60 days • No upfront commitment
Discover more resources

You may also like

Mock Tests

View All
  • GATE
  • beginner
  • 3 hours
  • civil engineering

Prepare for GATE 2026 Civil Engineering with the latest question papers, previous year papers, detailed solutions, syllabus, exam pattern, preparation tips, mock tests, and subject-wise study material. Download GATE 2026 CE question papers with solutions in PDF format and boost your preparation for top engineering institutes and PSU recruitment.

  • GATE
  • beginner
  • 3 hours
  • electronics and communication engineering

Prepare effectively for GATE 2026 Electronics & Communication Engineering (EC) with this comprehensive Question Paper with Solutions. This resource includes detailed explanations, concept-wise solutions, previous year paper analysis, and exam-oriented practice to help aspirants strengthen core subjects like Electronic Devices, Analog Circuits, Digital Circuits, Signals & Systems, Network Theory, Control Systems, Electromagnetics, Communications, and more. Perfect for revision, self-assessment, and boosting your GATE 2026 EC preparation strategy.

Ask AI Tutor
5 left
Q1 View Question & Options
AI Tutor is solving this question...
Reading question context & options...
Ask your own doubt or choose a quick prompt: