Verse Dt3126b states
Take this book of the law, and put it by the side of the ark of the covenant of HaShem your Gd, that it may be there for a witness against thee.
Rashi explains this verse with a numerically labelled diagram
ARK 15 handbreadths
'                     
' 9  
'  
'  Two tablets(10 commandments) 
' 9  6 x 6 + 6 x 6 = 12 x 6 Sefer  9 HANDBREADTHS
Torah
'  2 x 8 
'  
' 9  
'                     
Here is a rough overview of computations
 The ark was 9 handbreadths by 15 handbreadths
 The 10 commandments were written on two tablets of stone
 Each tablet was 6 handbreadth by 6 handbreadths
 Two tablets were 12 handbreadths by 6 handbreadths
 The length had 15  12 = 3 handbreadths left over
 The sides were each half a handbreath leaving 2 handbreadths
 So left over was 2 handbreadths x 8 handbreadths = 8 inches x 32 inches
 We infer that the Scroll of Torah Law was 8 x 32 inches and laid in the ark
 The diagram above illustrates this.
There are many problems with the above approach.
We still have room on the
sides since the tablets were 6 handbreadths and there are 23
handbreadths left over (Some say the broken chips of the first
tablets are there).
There are opinions that each cubit was 5 not 6 handbreadths only
giving us 12.5 handbreadths length. The major point to take
away is that Rashi interprets the verselet place the Torah
by the side of the ark to mean The Torah was placed in
the ark and there was room for it there.
