Carbon nanotubes (CNTs) show promise for high energy efficiency electronic devices due to their high electrical conductivity. One possible application is in the fabrication of resistance-change computer memory, where the application of an external electrical bias can use a CNT layer as the switching element in a RAM cell. Memory cells of this type have been extensively demonstrated, where the electrical resistance of a switching layer of CNTs can be reversibly controlled by the application of external bias [1].To better understand these devices, we have developed a nanoscale model of their electrical switching. Towards this end, first-principles calculations of the electrical conductivity of CNT-CNT junctions were performed using the Density Functional Tight Binding (DFTB) in combination with the Non-Equilibrium Greens functions (NEGF) approach, enabling an improved understanding of the tunnelling of electrons across a range of CNT junctions [2]. These results demonstrate that the conductivity of CNT contacts depends on the overlap area between nanotubes and exponentially on the distances between the carbon atoms of the interacting CNTs. Secondly, we employed coarse-grained molecular dynamics [3,4] to produce nanoscale dense CNT film models like those used in the devices. We devise a set of metrics for characterising the structural properties of CNT films, and apply them to a set of model films designed to mimic those used in microelectronics devices. In order to understand how the geometrical properties of CNTs affect the film structure, we analyse films with different CNT chirality and length distributions. Unlike previous studies that focused on relatively low-density systems below ∼0.4 g/cm3, we also consider films with density of ∼0.6 g/cm3, as employed in experimentally fabricated CNT-based NRAM devices. By adding amorphous carbon to the film models, in varying amounts, we are then able to assess its effects. Finally, these two elements were combined to produce electrical simulations of the conductivity of the CNT films connected to TiN electrodes. These electrodes are shown to be partially oxidized during the device fabrication. The electrical conductivity in a device is characterized by formation of conduction paths formed by CNTs between the electrodes and connected via the CNT junctions. The conductivity is modulated by charging of CNTs and amorphous carbon present in the film.Using these simulations, we propose a resistance switching mechanism in TiN/CNT/TiN devices based on the physical movement of CNTs. During the initial operation of the device, oxygen is released from the oxidized bottom electrode and this readily reacts with individual CNTs to form charge trapping sites. Once these sites have become charged, they enable controllable movement of CNTs at the bottom electrode under the application of electric field. By reversibly connecting and disconnecting such CNTs from the bottom electrode, the electrical conductivity through the CNT film as a whole can be controlled.