Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Aptitude
  • Engineering Mathematics
  • Discrete Mathematics
  • Operating System
  • DBMS
  • Computer Networks
  • Digital Logic and Design
  • C Programming
  • Data Structures
  • Algorithms
  • Theory of Computation
  • Compiler Design
  • Computer Org and Architecture
Open In App
Next Article:
Size of ROM for n-bit Adder/Subtractor
Next article icon

Size of ROM for n-bit Adder/Subtractor

Last Updated : 15 Feb, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

ROM is a read-only memory which is used to store the data. The memory in the ROM is organized as a two-dimensional array of memory cells. The memory will read or write the contents of one of the rows of the array. This row is specified by an Address which are bits. The value read or written is called Data. 

Figure a) shows a memory array with two address bits and three data bits. The two address bits specify one of the four rows (data words) in the array. Each data word is three bits wide. 
Figure b) shows some possible contents of the memory array.

An array of memory cells with n-bit addresses and m-bit data will have 2^n rows and m columns as shown in the figure. Each row of data is called a word. Thus, the array contains a 2^n word x m -bit array.

In the case of figure, the array of memory cells with 2-bit addresses and 3-bit Data will have 2^2 rows which are 4 and 3 columns, so thus the array contains 2^n x m = 2^2 x 3 = 4-word x 3 -bit array.

To get clear understanding let's take 10 address bits and 32 Data bits then the size of the ROM would be -

2^(10) x 32 = 1024 x 32 = 32 Kb

Now to find the size of the ROM we need to find the number of inputs and output bits -

Number of inputs = n(A) + n(B) + 1(Cin) = 2n+1 address bits

Number of outputs = n(sum/diff) + 1(Cout) = n+1  

Thus, this would require a 2^(2n+1) x (n+1) -bit ROM.

Here, n(A) means the number of inputs for A and n(B) means the number of inputs for B.

Example-1 : Size of the ROM you could use to program for 16-bit adder/subtractor with Cin and Cout is ____?

Solution : 

Number of inputs = 16 (A) + 16 (B) + 1(Cin) = 2(16)+1 = 33 address bits.

Number of outputs = 16 (sum/diff) + 1(Cout) = 16+1 = 17

Thus, this would require a 2^(2n+1)x(n+1) = 2^(33)x17 bit ROM.

Example-2 : Size of the ROM you could use to program for 8-bit adder/subtractor with Cin and Cout is ____?

Solution :

Number of inputs = 8 (A) + 8 (B) + 1(Cin) = 2(8)+1 = 17 address bits.

Number of outputs = 8 (sum/diff) + 1(Cout) = 8+1 = 9

Thus, this would require a 2^(2n+1)x(n+1) = 2^(17)x9 bit ROM.

Next Article
Size of ROM for n-bit Adder/Subtractor

G

gurukiranx
Improve
Article Tags :
  • Technical Scripter
  • Computer Organization & Architecture
  • Digital Logic
  • Technical Scripter 2020

Similar Reads

    4-bit binary Adder-Subtractor
    In Digital Circuits, A Binary Adder-Subtractor is can do both the addition and subtraction of binary numbers in one circuit itself. The operation is performed depending on the binary value the control signal holds. It is one of the components of the ALU (Arithmetic Logic Unit). What is Binary Adder?
    6 min read
    Adders and Subtractors in Digital Logic
    Adders and subtractors are digital circuits used to perform arithmetic operations on binary numbers. An adder adds two binary values to produce a sum and often including a carry bit for values that exceed a single digit. A subtractor calculates the difference between two binary numbers, sometimes us
    3 min read
    Half Subtractor in Digital Logic
    A half subtractor is a digital logic circuit that performs the binary subtraction of two single-bit binary numbers. It has two inputs, A and B, and two outputs, Difference and Borrow. The Difference output represents the result of subtracting B from A, while the Borrow output indicates whether a bor
    4 min read
    Full Subtractor in Digital Logic
    A Full Subtractor is a combinational circuit used to perform binary subtraction. It has three inputs:A (Minuend)B (Subtrahend)B-IN (Borrow-in from the previous stage)It produces two outputs:Difference (D): The result of the subtraction.Borrow-out (B-OUT): Indicates if a borrow is needed for the next
    3 min read
    Parallel Adder and Parallel Subtractor
    An adder adds two binary numbers one bit at a time using carry from each step. A subtractor subtracts one binary number from another using borrow when needed. A parallel adder adds all bits at once, making addition faster. Similarly, a parallel subtractor subtracts all bits at the same time for quic
    5 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences