Do I have to know RAM architecture to learn C & Java?

C, C++, Visual C++, C++.Net Topics
Post Reply
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Do I have to know RAM architecture to learn C & Java?

Post by Neo » Wed Jun 08, 2011 10:08 am

Nipuna asked me this question over a PM so I thought it could be helpful to answer over the forum.

C/C++ and Pointers - It is better if you know about memory architecture. Basically types of memory (RAM, ROM, EEPROM, FLASH) you have on-board (on PC only RAM), Starting address of each memory & size, restricted & special areas (Such as BIOS & DMA) on them, etc...

But don't worry too much on them for now. Unless you are doing embedded development on Microcontrollers or DSPs, you don't have to worry to much.

There is something called Dynamic Memory Allocation in C/C++ which involves pointers. The simply theory is whenever you allocate dynamic memory (an array we create at runtime), you need to deallocate them when you no longer use it or at program exit by yourself. Otherwise your RAM will become wasted with dangling pointers (unused but unusable memory).

Java doesn't have either pointers or dynamic memory allocation. It simplifies the complexities (however less control) by allowing the user to define classes/arrays at any point and removing unused memory (used for classes/arrays) using an automatic background task. All unused and no longer needed memory are deallocated and return to the Operating System by this. This is called Garbage Collection.

I strongly believe that every programmer should refer the book Computer Architecture: A Quantitative Approach by Hennessy and Patterson. Everybody should have at least some knowledge in this subject and be able write a few lines in Assembly code (Symbolic instruction set of machine code). I found few youngsters who believe the objects are identified at the CPU level. No joking. This is the truth and the result of "Thinking in objects" without having even a simple idea on 1 0s that do the actual thing.
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: Do I have to know RAM architecture to learn C & Java?

Post by Nipuna » Wed Jun 08, 2011 9:29 pm

Thanks for Helping Friend.

You told me about this book before and i have it already. But didn't read :)
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Do I have to know RAM architecture to learn C & Java?

Post by Neo » Wed Jun 08, 2011 10:08 pm

Don't push yourself to read & learn everything all at once which is not possible for anybody. It is no use to collect things from here and there. It is very important to know what you know perfectly without any doubt.

Best thing is to concentrate the subject in your syllabus and pass the exams with a good merit. Don't take them easy. Lots of students told me the exams are very difficult that they thought. Of cause university level is that. Nothing is easy. Unless you learn things and practice, you will face difficulties.
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: Do I have to know RAM architecture to learn C & Java?

Post by Nipuna » Wed Jun 08, 2011 10:14 pm

But Tell me Ways to Study. I don't have an Idea :?
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Do I have to know RAM architecture to learn C & Java?

Post by Neo » Wed Jun 08, 2011 11:42 pm

I'm answering you for this question since I already know that you are doing BIT of UCSC.

Take BIT syllabus. Aim the subjects that you have for the coming semester. Find recommended references (books) for each subject. After reading a chapter, try to answer the questions on both book and model paper. Try to find pass papers (I'm not sure this is possible at all). See whether you can find them from UCSC by calling them.

Likewise, make sure you are prepared for all subjects before the exam. Just take my word. Exams of UCSC are highly standard just as in other state universities. So be prepared.
User avatar
Nipuna
Moderator
Moderator
Posts: 2729
Joined: Mon Jan 04, 2010 8:02 pm
Location: Deraniyagala,SRI LANKA

Re: Do I have to know RAM architecture to learn C & Java?

Post by Nipuna » Thu Jun 09, 2011 5:18 am

Thanks Friend.

I can find all the Past Papers and Model papers from www.bit.lk website.
Post Reply

Return to “C/C++ Programming”