A secret passcode composed of numbers in authenticating the genuine user is recognised as personal identification number (PIN). A PIN is utilised to authenticate the identity of the legitimate person to access debit/credit card in an ATM or online. In general personal identification number is used to validate the legitimate user for transactions like credit card, debit card; online and also in accessing mobile telephones. In banking sectors, as a part of two factor authentication ATM card assumes noteworthy part, PIN serves as a legalised application to distinguish the authenticated user. PIN commonly contains four digits; to generate this four digit access code new behavioural model has been proposed. This paper exhibits PIN generation technique made out of a finite number of states utilising 'regular grammar' and 'context free grammar'. Programming language Python generating PIN of four digit numbers is also offered in this paper. To perceive the produced four-digit ATM PIN computational mathematical model known as a 'finite state machine' and 'pushdown automata' has been utilised.