A method and apparatus for reducing a RAM size while maintaining a fast data access